当前位置: 首页>>代码示例>>PHP>>正文


PHP is_blank函数代码示例

本文整理汇总了PHP中is_blank函数的典型用法代码示例。如果您正苦于以下问题:PHP is_blank函数的具体用法?PHP is_blank怎么用?PHP is_blank使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_blank函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseParams

 public function parseParams()
 {
     $params = array();
     if ($this->uri) {
         $params = array_values(array_filter(explode('/', $this->uri), function ($v) {
             return false == is_blank($v);
         }));
     }
     array_walk($params, function (&$v) {
         $v = rawurldecode($v);
     });
     if ($this->mapkey) {
         $segments = array_values(array_filter(explode('/:', $this->mapkey), function ($v) {
             return false == is_blank($v) and $v != '/';
         }));
         foreach ($segments as $k => $p) {
             if (isset($params[$k])) {
                 $params[$p] = $params[$k];
                 unset($params[$k]);
             } else {
                 $params[$p] = null;
             }
         }
     }
     return $params;
 }
开发者ID:undercloud,项目名称:olifant,代码行数:26,代码来源:request.php

示例2: date_strtotime

/**
 * gets Unix timestamp from date string
 * @param string $p_date A valid date/time string (see http://php.net/manual/en/datetime.formats.php)
 * @return false|int a timestamp on success, null date when $p_date is blank or false on failure.
 * @access public
 */
function date_strtotime($p_date)
{
    if (is_blank($p_date)) {
        return date_get_null();
    }
    return strtotime($p_date);
}
开发者ID:spring,项目名称:spring-website,代码行数:13,代码来源:date_api.php

示例3: email_queue_add

function email_queue_add($p_email_data)
{
    $t_email_data = email_queue_prepare_db($p_email_data);
    # email cannot be blank
    if (is_blank($t_email_data->email)) {
        error_parameters(lang_get('email'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    # subject cannot be blank
    if (is_blank($t_email_data->subject)) {
        error_parameters(lang_get('subject'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    # body cannot be blank
    if (is_blank($t_email_data->body)) {
        error_parameters(lang_get('body'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    $t_email_table = config_get('mantis_email_table');
    $c_email = $t_email_data->email;
    $c_subject = $t_email_data->subject;
    $c_body = $t_email_data->body;
    $c_metadata = serialize($t_email_data->metadata);
    $query = "INSERT INTO {$t_email_table}\r\n\t\t\t\t    ( email,\r\n\t\t\t\t      subject,\r\n\t\t\t\t\t  body,\r\n\t\t\t\t\t  submitted,\r\n\t\t\t\t\t  metadata)\r\n\t\t\t\t  VALUES\r\n\t\t\t\t    ( '{$c_email}',\r\n\t\t\t\t      '{$c_subject}',\r\n\t\t\t\t      '{$c_body}',\r\n\t\t\t\t\t  " . db_now() . ",\r\n\t\t\t\t\t  '{$c_metadata}'\r\n\t\t\t\t\t)";
    db_query($query);
    return db_insert_id($t_email_table);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:27,代码来源:email_queue_api.php

示例4: validate

 public function validate()
 {
     if (is_blank($this->tmp_name)) {
         $this->errors->add('파일을 선택해 주세요.');
         return false;
     }
     if (!empty($this->validate_types) && !in_array($this->type, $this->validate_types)) {
         //$this->errors->add('"' . $this->type . '"은 허용된 파일 타입이 아닙니다.');
         $this->errors->add('허용된 파일 타입이 아닙니다.');
         return false;
     }
     $names = explode('.', $this->name);
     $extension = end($names);
     if (!empty($this->validate_extensions) && !preg_grep("/{$extension}/i", $this->validate_extensions)) {
         //$this->errors->add('"' . end(explode('.', $this->name)) . '"은 허용된 파일 타입이 아닙니다.');
         $this->errors->add('허용된 파일 타입이 아닙니다.');
         return false;
     }
     if ($this->size > $this->max_upload_size) {
         $this->errors->add('최대 크기를 초과하였습니다.');
         return false;
     }
     if ($this->error > 0) {
         $this->errors->add('파일 업로드 중 오류가 발생하였습니다.');
         return false;
     }
     return true;
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:28,代码来源:active_upload.class.php

示例5: custom_function_default_roadmap_print_issue

function custom_function_default_roadmap_print_issue($p_issue_id, $p_issue_level = 0)
{
    static $t_status;
    $t_bug = bug_get($p_issue_id);
    if (bug_is_resolved($p_issue_id)) {
        $t_strike_start = '<strike>';
        $t_strike_end = '</strike>';
    } else {
        $t_strike_start = $t_strike_end = '';
    }
    if ($t_bug->category_id) {
        $t_category_name = category_get_name($t_bug->category_id);
    } else {
        $t_category_name = '';
    }
    $t_category = is_blank($t_category_name) ? '' : '<b>[' . string_display_line($t_category_name) . ']</b> ';
    echo utf8_str_pad('', $p_issue_level * 6, '&#160;'), '- ', $t_strike_start, string_get_bug_view_link($p_issue_id), ': ', $t_category, string_display_line_links($t_bug->summary);
    if ($t_bug->handler_id != 0) {
        echo ' (', prepare_user_name($t_bug->handler_id), ')';
    }
    if (!isset($t_status[$t_bug->status])) {
        $t_status[$t_bug->status] = get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
    }
    echo ' - ', $t_status[$t_bug->status], $t_strike_end, '.<br />';
}
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:25,代码来源:custom_function_api.php

示例6: email_queue_add

/**
 * Add to email queue
 * @param EmailData $p_email_data
 * @return int
 */
function email_queue_add($p_email_data)
{
    $t_email_data = email_queue_prepare_db($p_email_data);
    # email cannot be blank
    if (is_blank($t_email_data->email)) {
        error_parameters(lang_get('email'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    # subject cannot be blank
    if (is_blank($t_email_data->subject)) {
        error_parameters(lang_get('subject'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    # body cannot be blank
    if (is_blank($t_email_data->body)) {
        error_parameters(lang_get('body'));
        trigger_error(ERROR_EMPTY_FIELD, ERROR);
    }
    $t_email_table = db_get_table('email');
    $c_email = $t_email_data->email;
    $c_subject = $t_email_data->subject;
    $c_body = $t_email_data->body;
    $c_metadata = serialize($t_email_data->metadata);
    $query = "INSERT INTO {$t_email_table}\n\t\t\t\t    ( email,\n\t\t\t\t      subject,\n\t\t\t\t\t  body,\n\t\t\t\t\t  submitted,\n\t\t\t\t\t  metadata)\n\t\t\t\t  VALUES\n\t\t\t\t    ( " . db_param() . ",\n\t\t\t\t      " . db_param() . ",\n\t\t\t\t      " . db_param() . ",\n\t\t\t\t\t  " . db_param() . ",\n\t\t\t\t\t  " . db_param() . "\n\t\t\t\t\t)";
    db_query_bound($query, array($c_email, $c_subject, $c_body, db_now(), $c_metadata));
    return db_insert_id($t_email_table, 'email_id');
}
开发者ID:kaos,项目名称:mantisbt,代码行数:32,代码来源:email_queue_api.php

示例7: validate_register

 public function validate_register()
 {
     if (is_blank($this->comment)) {
         $this->errors->add('댓글을 입력해 주세요.');
         return false;
     }
     return true;
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:8,代码来源:blog_comment.class.php

示例8: fill_blank_array

function fill_blank_array($mas, $str) {
	foreach ($mas as $key => $value) {
		if (is_blank($value)) {
			$mas[$key] = $str;
		}
	}
	return $mas;
}
开发者ID:Atiragram,项目名称:poit-labs,代码行数:8,代码来源:lab4.php

示例9: print_unread_icon

function print_unread_icon($p_unread = READ)
{
    $t_icon_path = config_get('icon_path');
    $t_unread_icon_arr = config_get('unread_icon_arr');
    $t_none = NONE;
    if (!is_blank($t_unread_icon_arr[$p_unread])) {
        print "<img src=\"{$t_icon_path}{$t_unread_icon_arr[$p_unread]}\" alt=\"\" />";
    } else {
        print "<img src=\"{$t_icon_path}{$t_status_icon_arr[$t_none]}\" alt=\"\" />";
    }
}
开发者ID:jin255ff,项目名称:company_website,代码行数:11,代码来源:icon_api.php

示例10: wiki_mediawiki_get_url_for_page_id

function wiki_mediawiki_get_url_for_page_id($p_page_id)
{
    $t_root_url = config_get_global('wiki_engine_url');
    $t_root_namespace = config_get('wiki_root_namespace');
    if (is_blank($t_root_namespace)) {
        $t_page_id = $p_page_id;
    } else {
        $t_page_id = $t_root_namespace . ':' . $p_page_id;
    }
    return $t_root_url . 'index.php/' . urlencode($t_page_id);
}
开发者ID:jin255ff,项目名称:company_website,代码行数:11,代码来源:wiki_mediawiki_api.php

示例11: url_repo

 public function url_repo($p_repo, $p_changeset = null)
 {
     $t_rev = '';
     $t_path = '';
     if (!is_null($p_changeset)) {
         $t_rev = '&rev=' . urlencode($p_changeset->revision);
     }
     if (!is_blank($p_repo->info['websvn_path'])) {
         $t_path = '&path=' . urlencode($p_repo->info['websvn_path']);
     }
     return $p_repo->info['websvn_url'] . 'listing.php?repname=' . urlencode($p_repo->info['websvn_name']) . "{$t_path}{$t_rev}&sc=1";
 }
开发者ID:01-Scripts,项目名称:source-integration,代码行数:12,代码来源:SourceWebSVN.php

示例12: validate_register

 public function validate_register()
 {
     if (is_blank($this->subject)) {
         $this->errors->add('제목을 입력해 주세요.');
         return false;
     }
     if (is_blank($this->content)) {
         $this->errors->add('내용을 입력해 주세요.');
         return false;
     }
     return true;
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:12,代码来源:blog.class.php

示例13: log_event

/**
 * Log an event
 * @param int $p_level
 * @param string $p_msg
 * @return null
 */
function log_event($p_level, $p_msg)
{
    global $g_log_levels;
    # check to see if logging is enabled
    $t_sys_log = config_get_global('log_level');
    if (0 == ($t_sys_log & $p_level)) {
        return;
    }
    $t_now = date(config_get_global('complete_date_format'));
    $t_level = $g_log_levels[$p_level];
    $t_plugin_event = '[' . $t_level . '] ' . $p_msg;
    if (function_exists('event_signal')) {
        event_signal('EVENT_LOG', array($t_plugin_event));
    }
    $t_php_event = $t_now . ' ' . $t_level . ' ' . $p_msg;
    $t_log_destination = config_get_global('log_destination');
    if (is_blank($t_log_destination)) {
        $t_destination = '';
    } else {
        # Use @ to avoid error when there is no delimiter in log destination
        @(list($t_destination, $t_modifiers) = explode(':', $t_log_destination, 2));
    }
    switch ($t_destination) {
        case 'file':
            error_log($t_php_event . PHP_EOL, 3, $t_modifiers);
            break;
        case 'firebug':
            if (!class_exists('FirePHP')) {
                if (file_exists(BASE_PATH . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'FirePHPCore' . DIRECTORY_SEPARATOR . 'FirePHP.class.php')) {
                    require_once BASE_PATH . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'FirePHPCore' . DIRECTORY_SEPARATOR . 'FirePHP.class.php';
                }
            }
            if (class_exists('FirePHP')) {
                static $firephp;
                if ($firephp === null) {
                    $firephp = FirePHP::getInstance(true);
                }
                $firephp->log($t_php_event);
                return;
            }
            // if firebug is not available, fall through
        // if firebug is not available, fall through
        default:
            # use default PHP error log settings
            error_log($t_php_event . PHP_EOL);
            break;
    }
    # If running from command line, echo log event to stdout
    if (php_sapi_name() == 'cli') {
        echo $t_php_event . PHP_EOL;
    }
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:58,代码来源:logging_api.php

示例14: getClientesCompuestosTotvs

/**
 * Trae los clientes compuestos del totvs de la base de datos SQL
 * @param bool $id
 */
function getClientesCompuestosTotvs($codigocc)
{
    $sql = "SELECT * FROM `acsa_totvs_clientes_compuestos` WHERE codigocc = '" . $codigocc . "'";
    $conn = getConnection();
    $result = executeSelect($sql, $conn);
    $clientes = array();
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_array($result)) {
            $clientes[] = array('codigocc' => trim($row['codigocc']), 'lojacc' => trim($row['lojacc']), 'codigo' => trim($row['codigo']), 'loja' => trim($row['loja']), 'nombre' => trim(is_blank(utf8_encode(stripslashes(str_replace("'", "", $row['nombre']))))));
        }
    }
    echo json_encode($clientes);
}
开发者ID:ACSAUruguay,项目名称:helpdesk,代码行数:17,代码来源:_acsa_ajax.php

示例15: mci_get_custom_field_id_from_objectref

/**
 * Get the custom field id given an object ref.  The id is set based on the following algorithm:
 * - id from objectref (if not zero).
 * - id corresponding to name in object ref.
 * - 0, if object ref doesn't contain an id or a name.
 *
 * @param ObjectRef  $p_object_ref   An associate array with "id" and "name" keys.
 */
function mci_get_custom_field_id_from_objectref($p_object_ref)
{
    if ((int) $p_object_ref['id'] != 0) {
        $t_id = (int) $p_object_ref['id'];
    } else {
        if (!is_blank($p_object_ref['name'])) {
            $t_id = custom_field_get_id_from_name($p_object_ref['name']);
        } else {
            $t_id = 0;
        }
    }
    return $t_id;
}
开发者ID:kaos,项目名称:mantisbt,代码行数:21,代码来源:mc_custom_field_api.php


注:本文中的is_blank函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。