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


PHP isNumber函数代码示例

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


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

示例1: SearchData

 function SearchData($catid, $vendor, $string)
 {
     $pIFACE = content_lookup(config_get('document-root') . '/price')->GetData();
     $words = explode(' ', preg_replace('/\\s+/', ' ', strtolower($string)));
     $result = array();
     if (!isNumber($catid)) {
         return $result;
     }
     $subcats = $pIFACE->GetCatalogueData(1, $catid);
     $vendor = strtolower(trim($vendor));
     for ($j = 0, $m = count($subcats); $j < $m; ++$j) {
         $data = $pIFACE->GetCatalogueData(2, $subcats[$j]['uid']);
         for ($i = 0, $n = count($data); $i < $n; ++$i) {
             $it = $data[$i];
             if ($vendor != '' && strtolower($it['vendor']) != $vendor) {
                 continue;
             }
             $found = true;
             $name = strtolower($it['name']);
             for ($k = 0, $l = count($words); $k < $l; ++$k) {
                 if (trim($words[$k]) == '') {
                     continue;
                 }
                 if (strpos($name, $words[$k]) == false) {
                     $found = false;
                     break;
                 }
             }
             if ($found) {
                 $result[] = $it;
             }
         }
     }
     return $result;
 }
开发者ID:Nazg-Gul,项目名称:e-marsa,代码行数:35,代码来源:market.php

示例2: MARKET_BasketAdd

 function MARKET_BasketAdd()
 {
     global $id, $MARKET;
     InitMarket();
     if (isNumber($id) && $MARKET->BASKET->AddItemById($id)) {
         print '+OK';
     } else {
         print '-ERR';
     }
 }
开发者ID:Nazg-Gul,项目名称:e-marsa,代码行数:10,代码来源:delete_task.php

示例3: MARKET_GetVendors

 function MARKET_GetVendors()
 {
     global $catid, $MARKET;
     InitMarket();
     if (isNumber($catid)) {
         print '+OK ' . $MARKET->GetVendorsJSON($catid);
     } else {
         print '-ERR';
     }
 }
开发者ID:Nazg-Gul,项目名称:e-marsa,代码行数:10,代码来源:get_vendors.php

示例4: validateYear

function validateYear($year)
{
    if (!isNumber($year)) {
        return false;
    }
    if ($year < 1900 || $year > 2016) {
        return false;
    }
    return true;
}
开发者ID:Dragomir89,项目名称:homeworck_lecture_20_forms,代码行数:10,代码来源:functions.php

示例5: verify

 public function verify()
 {
     // Verify that the elt we want to add is correct
     /* verify only the datatype */
     if (strlen(trim($this->ad_text)) == 0) {
         throw new Exception('La description ne peut pas être vide', 1);
     }
     if (strlen(trim($this->ad_type)) == 0) {
         throw new Exception('Le type ne peut pas être vide', 1);
     }
     $this->ad_type = strtolower($this->ad_type);
     if (in_array($this->ad_type, array('date', 'text', 'numeric', 'zone', 'poste', 'card', 'select')) == false) {
         throw new Exception('Le type doit être text, numeric,poste, card, select ou date', 1);
     }
     if (trim($this->ad_size) == '' || isNumber($this->ad_size) == 0 || $this->ad_size > 22) {
         switch ($this->ad_type) {
             case 'text':
                 $this->ad_size = 22;
                 break;
             case 'numeric':
                 $this->ad_size = 9;
                 break;
             case 'date':
                 $this->ad_size = 8;
                 break;
             case 'zone':
                 $this->ad_size = 22;
                 break;
             default:
                 $this->ad_size = 22;
         }
     }
     if ($this->ad_type == 'numeric') {
         $this->ad_extra = trim($this->ad_extra) == '' ? '2' : $this->ad_extra;
         if (isNumber($this->ad_extra) == 0) {
             throw new Exception("La précision doit être un chiffre");
         }
     }
     if ($this->ad_type == 'select') {
         if (trim($this->ad_extra) == "") {
             throw new Exception("La requête SQL est vide ");
         }
         if (preg_match('/^\\h*select/i', $this->ad_extra) == 0) {
             throw new Exception("La requête SQL doit commencer par SELECT ");
         }
         try {
             $this->cn->exec_sql($this->ad_extra);
         } catch (Exception $e) {
             throw new Exception("La requête SQL " . h($this->ad_extra) . " est invalide ");
         }
     }
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:52,代码来源:class_fiche_attr.php

示例6: validateFORM

function validateFORM(&$errors)
{
    global $n1, $n2, $operator;
    if (!validateRequred($n1)) {
        $errors['number1'][] = 'This field is reqired';
    } elseif (!isNumber($n1)) {
        $errors['number1'][] = 'Invalid input';
    }
    if (!validateRequred($n2)) {
        $errors['number2'][] = 'Invalid input';
    } elseif (!isNumber($n2)) {
        $errors['number2'][] = 'This field is reqired';
    }
}
开发者ID:Dragomir89,项目名称:homeworck_lecture_20_forms,代码行数:14,代码来源:task_01.php

示例7: check

 public function check($p_idx, &$p_value)
 {
     if (strcmp($p_idx, 'tl_id') == 0) {
         if (strlen($p_value) > 6 || isNumber($p_value) == false) {
             return false;
         }
     }
     if (strcmp($p_idx, 'tl_date') == 0) {
         if (strlen(trim($p_value)) == 0 || strlen($p_value) > 12 || isDate($p_value) == false) {
             return false;
         }
     }
     if (strcmp($p_idx, 'tl_title') == 0) {
         $p_value = mb_substr($p_value, 0, 120);
         return true;
     }
     if (strcmp($p_idx, 'tl_desc') == 0) {
         $p_value = mb_substr($p_value, 0, 400);
         return true;
     }
     return true;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:22,代码来源:class_todo_list.php

示例8: from_array

 public function from_array($p_array)
 {
     extract($p_array);
     $ret = array();
     $ix = 0;
     $found = 0;
     foreach ($p_array as $r) {
         if (isset(${'form' . $ix}) && isset(${'text' . $ix})) {
             $obj = new Acc_Report_Row(${'text' . $ix}, ${'form' . $ix});
             if (isset(${'pos' . $ix}) && isNumber(${'pos' . $ix}) == 1) {
                 $obj->set_parameter("position", ${'pos' . $ix});
             } else {
                 $obj->set_parameter("position", $found);
                 $found++;
             }
             $obj->fo_id = 0;
             $obj->fo_fr_id = $this->fo_fr_id;
             $obj->db = $this->db;
             $ret[] = clone $obj;
         }
         $ix++;
     }
     return $ret;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:24,代码来源:class_acc_report_row.php

示例9: contentNameSort

function contentNameSort($content, $sType)
{
    $splStr = '';
    $arrayStr = aspArray(99);
    $fileName = '';
    $isOther = '';
    $otherStr = '';
    $id = '';
    $c = '';
    $s = '';
    $i = '';
    $left1 = '';
    $splStr = aspSplit($content, vbCrlf());
    foreach ($splStr as $key => $s) {
        if ($s != '') {
            $fileName = getStrFileName($s);
            $isOther = true;
            $left1 = left($fileName, 1);
            if (inStr($fileName, '、') > 0) {
                $id = replace(left($fileName, 2), '、', '');
                if (isNumber($id)) {
                    $arrayStr[$id] = $arrayStr[$id] . $s . vbCrlf();
                    $isOther = false;
                }
            }
            if (inStr($sType, $left1) == false && $isOther == true) {
                $otherStr = $otherStr . $s . vbCrlf();
            }
        }
    }
    for ($i = 0; $i <= uBound($arrayStr); $i++) {
        $c = $c . $arrayStr[$i];
    }
    $contentNameSort = $c . $otherStr;
    return @$contentNameSort;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:36,代码来源:2014_Array.php

示例10: header

    echo '<script>window.location="admin_login.php";</script>';
    header("location:admin_login.php");
    //把浏览器重定向
    ob_end_flush();
    //输出全部内容到浏览器
}
if ($_REQUEST['gid'] == NULL) {
    ob_start();
    //打开缓冲区
    echo '<script>window.location="admin_mgr_goods.php";</script>';
    header("location:admin_mgr_goods.php");
    //把浏览器重定向
    ob_end_flush();
    //输出全部内容到浏览器
}
if (isNumber($_REQUEST['gid']) == false) {
    ob_start();
    //打开缓冲区
    echo '<script>window.location="admin_mgr_goods.php";</script>';
    header("location:admin_mgr_goods.php");
    //把浏览器重定向
    ob_end_flush();
    //输出全部内容到浏览器
} else {
    $gid = $_REQUEST['gid'];
}
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
开发者ID:whitetrefoil,项目名称:TL_RO,代码行数:31,代码来源:admin_edit_r_goods.php

示例11: InitMarket

}
global $MARKET, $ipc, $action;
InitMarket();
/* Some optimization stuff */
$serv_ipc_procs = '#basket_add#';
if ($ipc != '') {
    $n = count($serv_ipc_procs);
    if (strpos($serv_ipc_procs, $ipc) > 0) {
        /* Execute IPC command */
        ipc_exec($ipc);
        die;
    }
}
if ($action == 'drop') {
    global $id;
    if (isNumber($id)) {
        $MARKET->BASKET->DropById($id);
    }
} else {
    if ($action == 'send') {
        $MARKET->BASKET->Send();
    }
}
if ($action != 'send') {
    $tpl = manage_template_by_name('Магазин / Корзина');
    $script = $tpl->GetText();
    $params = array();
    tpl_srcp($script, $params);
} else {
    $tpl = manage_template_by_name('Магазин / Корзина / Заказ отправлен');
    $script = $tpl->GetText();
开发者ID:Nazg-Gul,项目名称:e-marsa,代码行数:31,代码来源:data.php

示例12: replace_special_tag

 /**
  *Replace a special tag *TAGxxxx with the value from fiche_detail, the xxxx
  * is the ad_value
  * @param $p_qcode qcode of the card
  * @param $p_tag tag to parse
  * @return  the ad_value contained in fiche_detail or for the type "select" the
  *          label
  */
 function replace_special_tag($p_qcode, $p_tag)
 {
     // check if the march exists
     if ($p_qcode == "") {
         return "";
     }
     $f = new Fiche($this->db);
     $found = $f->get_by_qcode($p_qcode, false);
     // if not found exit
     if ($found == 1) {
         return "";
     }
     // get the ad_id
     $attr = preg_replace("/^.*ATTR/", "", $p_tag);
     if (isNumber($attr) == 0) {
         return "";
     }
     $ad_type = $this->db->get_value("select ad_type from attr_def where ad_id=\$1", array($attr));
     // get ad_value
     $ad_value = $this->db->get_value("select ad_value from fiche_detail where f_id=\$1 and ad_id=\$2", array($f->id, $attr));
     // if ad_id is type select execute select and get value
     if ($ad_type == "select") {
         $sql = $this->db->get_value("select ad_extra from attr_def where ad_id=\$1", array($attr));
         $array = $this->db->make_array($sql);
         for ($a = 0; $a < count($array); $a++) {
             if ($array[$a]['value'] == $ad_value) {
                 return $array[$a]['label'];
             }
         }
     }
     // if ad_id is not type select get value
     return $ad_value;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:41,代码来源:class_document.php

示例13: catch

        }
    } catch (Exception $exc) {
        echo $exc->getTraceAsString();
        throw $exc;
    }
}
//**********************************************
// Save_name
// *********************************************
if (isset($_POST['save_name'])) {
    extract($_POST);
    try {
        if (strlen(trim($p_name)) == 0) {
            throw new Exception("Nom ne peut être vide");
        }
        if (isNumber($p_id) == 0) {
            throw new Exception("profile Invalide");
        }
        $wc = isset($with_calc) ? 1 : 0;
        $wd = isset($with_direct_form) ? 1 : 0;
        $p_desc = strlen(trim($p_desc)) == 0 ? null : trim($p_desc);
        if ($p_id != -1) {
            $cn->exec_sql("update profile set p_name=\$1,p_desc=\$2,\n\t\t\t\t\twith_calc=\$3, with_direct_form=\$4 where p_id=\$5", array($p_name, $p_desc, $wc, $wd, $p_id));
        } else {
            $p_id = $cn->get_value("insert into profile (p_name,\n\t\t\t\tp_desc,with_calc,with_direct_form) values\n\t\t\t\t(\$1,\$2,\$3,\$4) returning p_id", array($p_name, $p_desc, $wc, $wd));
        }
    } catch (Exception $e) {
        alert($e->getMessage());
    }
}
//************************************
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:profile.inc.php

示例14: header

        // Add a share to the user
        $todo->add_share($p_login);
    } else {
        // remove a share from the user
        $todo->remove_share($p_login);
    }
}
////////////////////////////////////////////////////////////////////////////////
// Remove the share of a note which the connected user doesn't own
//
////////////////////////////////////////////////////////////////////////////////
if ($ac == "remove_share") {
    $id = HtmlInput::default_value_get("todo_id", 0);
    $p_login = HtmlInput::default_value_get("login", "");
    // If note_id is not correct then give an error
    if ($id == 0 || isNumber($id) == 0 || trim($p_login) == "") {
        header('Content-type: text/xml; charset=UTF-8');
        $dom = new DOMDocument('1.0', 'UTF-8');
        $status = $dom->createElement('status', "nok");
        $tl_id = $dom->createElement('content', _("Erreur : paramètre invalide"));
        $dom->appendChild($status);
        $dom->appendChild($tl_id);
        echo $dom->saveXML();
        return;
    }
    $todo = new Todo_List($cn);
    $todo->set_parameter("id", $id);
    $todo->load();
    $todo->remove_share($p_login);
    header('Content-type: text/xml; charset=UTF-8');
    $dom = new DOMDocument('1.0', 'UTF-8');
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:ajax_todo_list.php

示例15: die

 * 
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
global $cn, $g_user;
require_once NOALYSS_INCLUDE . '/class_anc_key.php';
$op = HtmlInput::default_value_request("op", "list");
switch ($op) {
    case 'list':
        Anc_Key::display_list();
        Anc_Key::key_add();
        break;
    case 'consult':
        $id = HtmlInput::default_value_request("key", "0");
        if (isNumber($id) == 0 || $id == 0) {
            die(_('Clef invalide'));
        }
        $key = new Anc_Key($id);
        if (isset($_POST['save_key'])) {
            try {
                $key->save($_POST);
                Anc_Key::display_list();
                Anc_Key::key_add();
                break;
            } catch (Exception $e) {
                echo span($e->getMessage(), ' class="notice"');
            }
        }
        $key->input();
        break;
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:anc_key.inc.php


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