• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_not_null函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: array

     $intro = '';
 }
 if (empty($ur_here)) {
     $ur_here = $_LANG['search_goods'];
 }
 /*------------------------------------------------------ */
 //-- 属性检索
 /*------------------------------------------------------ */
 $attr_in = '';
 $attr_num = 0;
 $attr_url = '';
 $attr_arg = array();
 if (!empty($_REQUEST['attr'])) {
     $sql = "SELECT goods_id, COUNT(*) AS num FROM " . $ecs->table("goods_attr") . " WHERE 0 ";
     foreach ($_REQUEST['attr'] as $key => $val) {
         if (is_not_null($val)) {
             $attr_num++;
             $sql .= " OR (1 ";
             if (is_array($val)) {
                 $sql .= " AND attr_id = '{$key}'";
                 if (!empty($val['from'])) {
                     $sql .= is_numeric($val['from']) ? " AND attr_value >= " . floatval($val['from']) : " AND attr_value >= '{$val['from']}'";
                     $attr_arg["attr[{$key}][from]"] = $val['from'];
                     $attr_url .= "&attr[{$key}][from]={$val['from']}";
                 }
                 if (!empty($val['to'])) {
                     $sql .= is_numeric($val['to']) ? " AND attr_value <= " . floatval($val['to']) : " AND attr_value <= '{$val['to']}'";
                     $attr_arg["attr[{$key}][to]"] = $val['to'];
                     $attr_url .= "&amp;attr[{$key}][to]={$val['to']}";
                 }
             } else {
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:search.php


示例2: array

     $intro = '';
 }
 if (empty($ur_here)) {
     $ur_here = $_LANG['search_goods'];
 }
 /*------------------------------------------------------ */
 //-- 属性检索
 /*------------------------------------------------------ */
 $attr_in = '';
 $attr_num = 0;
 $attr_url = '';
 $attr_arg = array();
 if (!empty($_REQUEST['attr'])) {
     $sql = "SELECT goods_id, COUNT(*) AS num FROM " . $ecs->table("goods_attr") . " WHERE 0 ";
     foreach ($_REQUEST['attr'] as $key => $val) {
         if (is_not_null($val) && is_numeric($key)) {
             $attr_num++;
             $sql .= " OR (1 ";
             if (is_array($val)) {
                 $sql .= " AND attr_id = '{$key}'";
                 if (!empty($val['from'])) {
                     $sql .= is_numeric($val['from']) ? " AND attr_value >= " . floatval($val['from']) : " AND attr_value >= '{$val['from']}'";
                     $attr_arg["attr[{$key}][from]"] = $val['from'];
                     $attr_url .= "&amp;attr[{$key}][from]={$val['from']}";
                 }
                 if (!empty($val['to'])) {
                     $sql .= is_numeric($val['to']) ? " AND attr_value <= " . floatval($val['to']) : " AND attr_value <= '{$val['to']}'";
                     $attr_arg["attr[{$key}][to]"] = $val['to'];
                     $attr_url .= "&amp;attr[{$key}][to]={$val['to']}";
                 }
             } else {
开发者ID:m7720647,项目名称:demo,代码行数:31,代码来源:search.php


示例3: elgg_format_attributes

/**
 * Converts an associative array into a string of well-formed attributes
 *
 * @note usually for HTML, but could be useful for XML too...
 *
 * @param array $attrs An associative array of attr => val pairs
 *
 * @return string HTML attributes to be inserted into a tag (e.g., <tag $attrs>)
 */
function elgg_format_attributes(array $attrs)
{
    $attrs = elgg_clean_vars($attrs);
    $attributes = array();
    if (isset($attrs['js'])) {
        //@todo deprecated notice?
        if (!empty($attrs['js'])) {
            $attributes[] = $attrs['js'];
        }
        unset($attrs['js']);
    }
    foreach ($attrs as $attr => $val) {
        $attr = strtolower($attr);
        if ($val === TRUE) {
            $val = $attr;
            //e.g. checked => TRUE ==> checked="checked"
        }
        // ignore $vars['entity'] => ElggEntity stuff
        if (is_not_null($val) && (is_array($val) || !is_object($var))) {
            // allow $vars['class'] => array('one', 'two');
            // @todo what about $vars['style']? Needs to be semi-colon separated...
            if (is_array($val)) {
                $val = implode(' ', $val);
            }
            $val = htmlspecialchars($val, ENT_QUOTES, 'UTF-8', false);
            $attributes[] = "{$attr}=\"{$val}\"";
        }
    }
    return implode(' ', $attributes);
}
开发者ID:rasul,项目名称:Elgg,代码行数:39,代码来源:output.php


示例4: ensure

function ensure($name, $value, $fn, $class = null, $method = null)
{
    if (!is_callable($fn)) {
        throw new InvalidArgumentException("#ensure: Given callback is not callable: " . sdump($fn));
    }
    if (!is_a_string($name)) {
        throw new InvalidArgumentException("#ensure: Given argument name is not a string: " . sdump($fn));
    }
    // TODO: Contract for $value
    if (is_not_null($class) && is_null($method)) {
        $method = $class;
        $class = null;
    }
    if (!$fn($value)) {
        throw new InvalidArgumentException("{$class}#{$method}: {$name} does not comply argument contract " . sdump($fn) . ": " . sdump($value) . ')');
    }
}
开发者ID:brainsware,项目名称:sauce,代码行数:17,代码来源:functions.php


示例5: build_message

 function build_message($params = '')
 {
     if ($params == '') {
         $params = array();
     }
     if (count($params) > 0) {
         reset($params);
         while (list($key, $value) = each($params)) {
             $this->build_params[$key] = $value;
         }
     }
     if (is_not_null($this->html_images)) {
         reset($this->html_images);
         while (list(, $value) = each($this->html_images)) {
             $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html);
         }
     }
     $null = NULL;
     $attachments = is_not_null($this->attachments) ? true : false;
     $html_images = is_not_null($this->html_images) ? true : false;
     $html = is_not_null($this->html) ? true : false;
     $text = is_not_null($this->text) ? true : false;
     switch (true) {
         case $text == true && $attachments == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_text_part($null, $this->text);
             $message = $this->add_text_part($null, $this->text);
             break;
         case $text == false && $attachments == true && $html == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $text == true && $attachments == true:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             $this->add_text_part($message, $this->text);
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $html == true && $attachments == false && $html_images == false:
             if (is_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_alternative_part($null);
                 $message = $this->add_alternative_part($null);
                 $this->add_text_part($message, $this->html_text);
                 $this->add_html_part($message);
             } else {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_html_part($null);
                 $message = $this->add_html_part($null);
             }
             break;
         case $html == true && $attachments == false && $html_images == true:
             if (is_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_alternative_part($null);
                 $message = $this->add_alternative_part($null);
                 $this->add_text_part($message, $this->html_text);
                 /* HPDL PHP3 */
                 //            $related =& $this->add_related_part($message);
                 $related = $this->add_related_part($message);
             } else {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_related_part($null);
                 //            $related =& $message;
                 $message = $this->add_related_part($null);
                 $related = $message;
             }
             $this->add_html_part($related);
             for ($i = 0; $i < count($this->html_images); $i++) {
                 $this->add_html_image_part($related, $this->html_images[$i]);
             }
             break;
         case $html == true && $attachments == true && $html_images == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             if (is_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $alt =& $this->add_alternative_part($message);
                 $alt = $this->add_alternative_part($message);
                 $this->add_text_part($alt, $this->html_text);
                 $this->add_html_part($alt);
             } else {
                 $this->add_html_part($message);
             }
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $html == true && $attachments == true && $html_images == true:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
//.........这里部分代码省略.........
开发者ID:centaurustech,项目名称:base-system,代码行数:101,代码来源:email.php


示例6: trimF

 public function trimF($characters = null)
 {
     if (is_not_null($characters)) {
         ensure('Argument', $characters, 'is_a_string', __CLASS__, __METHOD__);
     }
     if (null !== $characters) {
         $this->string = trim($this->string, $characters);
     } else {
         $this->string = trim($this->string);
     }
     return $this;
 }
开发者ID:brainsware,项目名称:sauce,代码行数:12,代码来源:SString.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_notpresent函数代码示例发布时间:2022-05-15
下一篇:
PHP is_not_guest函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap