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

PHP intval函数代码示例

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

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



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

示例1: onls

 function onls()
 {
     $logdir = UC_ROOT . 'data/logs/';
     $dir = opendir($logdir);
     $logs = $loglist = array();
     while ($entry = readdir($dir)) {
         if (is_file($logdir . $entry) && strpos($entry, '.php') !== FALSE) {
             $logs = array_merge($logs, file($logdir . $entry));
         }
     }
     closedir($dir);
     $logs = array_reverse($logs);
     foreach ($logs as $k => $v) {
         if (count($v = explode("\t", $v)) > 1) {
             $v[3] = $this->date($v[3]);
             $v[4] = $this->lang[$v[4]];
             $loglist[$k] = $v;
         }
     }
     $page = max(1, intval($_GET['page']));
     $start = ($page - 1) * UC_PPP;
     $num = count($loglist);
     $multipage = $this->page($num, UC_PPP, $page, 'admin.php?m=log&a=ls');
     $loglist = array_slice($loglist, $start, UC_PPP);
     $this->view->assign('loglist', $loglist);
     $this->view->assign('multipage', $multipage);
     $this->view->display('admin_log');
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:28,代码来源:log.php


示例2: search_ac_init

function search_ac_init(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $start = x($_REQUEST, 'start') ? $_REQUEST['start'] : 0;
    $count = x($_REQUEST, 'count') ? $_REQUEST['count'] : 100;
    $search = x($_REQUEST, 'search') ? $_REQUEST['search'] : "";
    if (x($_REQUEST, 'query') && strlen($_REQUEST['query'])) {
        $search = $_REQUEST['query'];
    }
    // Priority to people searches
    if ($search) {
        $people_sql_extra = protect_sprintf(" AND `xchan_name` LIKE '%" . dbesc($search) . "%' ");
        $tag_sql_extra = protect_sprintf(" AND term LIKE '%" . dbesc($search) . "%' ");
    }
    $r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d \n\t\t{$people_sql_extra}\n\t\tORDER BY `xchan_name` ASC ", intval(local_channel()));
    $results = array();
    if ($r) {
        foreach ($r as $g) {
            $results[] = array("photo" => $g['xchan_photo_s'], "name" => '@' . $g['xchan_name'], "id" => $g['abook_id'], "link" => $g['xchan_url'], "label" => '', "nick" => '');
        }
    }
    $r = q("select distinct term, tid, url from term where type in ( %d, %d ) {$tag_sql_extra} group by term order by term asc", intval(TERM_HASHTAG), intval(TERM_COMMUNITYTAG));
    if (count($r)) {
        foreach ($r as $g) {
            $results[] = array("photo" => $a->get_baseurl() . '/images/hashtag.png', "name" => '#' . $g['term'], "id" => $g['tid'], "link" => $g['url'], "label" => '', "nick" => '');
        }
    }
    header("content-type: application/json");
    $o = array('start' => $start, 'count' => $count, 'items' => $results);
    echo json_encode($o);
    logger('search_ac: ' . print_r($x, true));
    killme();
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:35,代码来源:search_ac.php


示例3: system_add_credentials

 function system_add_credentials()
 {
     if (!isset($_POST['AddCredentials'])) {
         $details = new stdClass();
         $details->system_id = intval($this->uri->segment(3, 0));
         if (!is_int($details->system_id) or $details->system_id == 0) {
             redirect('main/list_devices');
         }
         $this->load->model("m_system");
         $this->data['system_id'] = $details->system_id;
         $this->data['ip_address'] = ip_address_from_db($this->m_system->check_man_ip_address($details->system_id));
         $this->data['heading'] = 'Add Device SNMP Credentials';
         $this->data['include'] = 'v_add_system_c';
         $this->load->view('v_template', $this->data);
     } else {
         $system_id = $_POST['system_id'];
         $this->load->model("m_system");
         $this->load->library('encrypt');
         if ($_POST['snmp_community'] > '' and $_POST['snmp_version'] > '' and $_POST['ip_address'] > '') {
             $encode['ip_address'] = $_POST['ip_address'];
             $encode['snmp_version'] = $_POST['snmp_version'];
             $encode['snmp_community'] = $_POST['snmp_community'];
             $encoded = json_encode($encode);
             $encoded = $this->encrypt->encode($encoded);
             $this->m_system->update_system_man($system_id, 'access_details', $encoded);
             if ($_POST['snmp_scan'] == TRUE) {
                 redirect('admin_system/system_snmp/' . $system_id);
             } else {
                 redirect('main/system_display/' . $system_id);
             }
         } else {
             redirect('admin_system/system_add_credentials/' . $system_id);
         }
     }
 }
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:35,代码来源:admin_system.php


示例4: _rotate_step

function _rotate_step($step, $mode = 1)
{
    $step_h = intval($step / 256);
    $step_l = $step % 256;
    $data = array(255, AGB_ID, 6, 105, 1, $mode, 1, $step_h, $step_l);
    send_data(PORT_AGB, $data);
}
开发者ID:ryden-inc,项目名称:2011-newyear-contents,代码行数:7,代码来源:common.php


示例5: filter_css_object

 function filter_css_object($css, $panels_data, $post_id)
 {
     foreach ($panels_data['grids'] as $gi => $grid) {
         $grid_id = !empty($grid['style']['id']) ? (string) sanitize_html_class($grid['style']['id']) : intval($gi);
         $top_padding = isset($grid['style']['top_padding']) ? $grid['style']['top_padding'] : null;
         $bottom_padding = isset($grid['style']['bottom_padding']) ? $grid['style']['bottom_padding'] : null;
         // Filter the bottom margin for this row with the arguments
         if ($top_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 1920);
         }
         if ($bottom_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 1920);
         }
         $top_padding = isset($grid['style']['tablet_top_padding']) ? $grid['style']['tablet_top_padding'] : null;
         $bottom_padding = isset($grid['style']['tablet_bottom_padding']) ? $grid['style']['tablet_bottom_padding'] : null;
         // Filter the bottom margin for this row with the arguments
         if ($top_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 960);
         }
         if ($bottom_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 960);
         }
         $top_padding = isset($grid['style']['mobile_top_padding']) ? $grid['style']['mobile_top_padding'] : null;
         $bottom_padding = isset($grid['style']['mobile_bottom_padding']) ? $grid['style']['mobile_bottom_padding'] : null;
         // Filter the bottom margin for this row with the arguments
         if ($top_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-top' => $top_padding), 478);
         }
         if ($bottom_padding) {
             $css->add_row_css($post_id, $grid_id, '.lsow-row', array('padding-bottom' => $bottom_padding), 478);
         }
     }
     return $css;
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:34,代码来源:class-lsow-setup.php


示例6: buildjs

function buildjs()
{
    $t = $_GET["t"];
    $time = time();
    $MEPOST = 0;
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $array = unserialize(@file_get_contents($GLOBALS["CACHEFILE"]));
    $prc = intval($array["POURC"]);
    $title = $tpl->javascript_parse_text($array["TEXT"]);
    $md5file = trim(md5_file($GLOBALS["LOGSFILES"]));
    echo "// CACHE FILE: {$GLOBALS["CACHEFILE"]} {$prc}%\n";
    echo "// LOGS FILE: {$GLOBALS["LOGSFILES"]} - {$md5file} " . strlen($md5file) . "\n";
    if ($prc == 0) {
        if (strlen($md5file) < 32) {
            echo "\n\t// PRC = {$prc} ; md5file={$md5file}\n\tfunction Start{$time}(){\n\t\t\tif(!RTMMailOpen()){return;}\n\t\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
            return;
        }
    }
    if ($md5file != $_GET["md5file"]) {
        echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    if ($prc > 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    if ($prc == 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\t\$('#SQUID_ARTICA_QUOTA_RULES').flexReload();\n\t\tRTMMailHide();\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
}
开发者ID:articatech,项目名称:artica,代码行数:34,代码来源:squid.global.wl.center.progress.php


示例7: nv_getAllowed

/**
 * nv_getAllowed()
 *
 * @return
 */
function nv_getAllowed()
{
    global $module_data, $db, $admin_info;
    $sql = 'SELECT id,full_name,admins FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department';
    $result = $db->query($sql);
    $contact_allowed = array('view' => array(), 'reply' => array(), 'obt' => array());
    while ($row = $result->fetch()) {
        $id = intval($row['id']);
        if (defined('NV_IS_SPADMIN')) {
            $contact_allowed['view'][$id] = $row['full_name'];
            $contact_allowed['reply'][$id] = $row['full_name'];
        }
        $admins = $row['admins'];
        $admins = array_map('trim', explode(';', $admins));
        foreach ($admins as $a) {
            if (preg_match('/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})$/i', $a)) {
                $admins2 = array_map('intval', explode('/', $a));
                if ($admins2[0] == $admin_info['admin_id']) {
                    if ($admins2[1] == 1 and !isset($contact_allowed['view'][$id])) {
                        $contact_allowed['view'][$id] = $row['full_name'];
                    }
                    if ($admins2[2] == 1 and !isset($contact_allowed['reply'][$id])) {
                        $contact_allowed['reply'][$id] = $row['full_name'];
                    }
                    if ($admins2[3] == 1 and !isset($contact_allowed['obt'][$id])) {
                        $contact_allowed['obt'][$id] = $row['full_name'];
                    }
                }
            }
        }
    }
    return $contact_allowed;
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:38,代码来源:admin.functions.php


示例8: hikashopSubscriptionType

 function hikashopSubscriptionType()
 {
     if (!HIKASHOP_PHP5) {
         $acl =& JFactory::getACL();
     } else {
         $acl = JFactory::getACL();
     }
     if (!HIKASHOP_J16) {
         $this->groups = $acl->get_group_children_tree(null, 'USERS', false);
     } else {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT a.*, a.title as text, a.id as value  FROM #__usergroups AS a ORDER BY a.lft ASC');
         $this->groups = $db->loadObjectList('id');
         foreach ($this->groups as $id => $group) {
             if (isset($this->groups[$group->parent_id])) {
                 $this->groups[$id]->level = intval(@$this->groups[$group->parent_id]->level) + 1;
                 $this->groups[$id]->text = str_repeat('- - ', $this->groups[$id]->level) . $this->groups[$id]->text;
             }
         }
     }
     $this->choice = array();
     $this->choice[] = JHTML::_('select.option', 'none', JText::_('HIKA_NONE'));
     $this->choice[] = JHTML::_('select.option', 'special', JText::_('HIKA_CUSTOM'));
     $js = "function updateSubscription(map){\r\n\t\t\tchoice = document.adminForm['choice_'+map];\r\n\t\t\tchoiceValue = 'special';\r\n\t\t\tfor (var i=0; i < choice.length; i++){\r\n\t\t\t\tif (choice[i].checked){\r\n\t\t\t\t\tchoiceValue = choice[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\thiddenVar = document.getElementById('hidden_'+map);\r\n\t\t\tif(choiceValue != 'special'){\r\n\t\t\t\thiddenVar.value = choiceValue;\r\n\t\t\t\tif(hiddenVar.value == 'none') hiddenVar.value = '';\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = 'none';\r\n\t\t\t}else{\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = '';\r\n\t\t\t\tspecialVar = eval('document.adminForm.special_'+map);\r\n\t\t\t\tfinalValue = '';\r\n\t\t\t\tfor (var i=0; i < specialVar.length; i++){\r\n\t\t\t\t\tif (specialVar[i].checked){\r\n\t\t\t\t\t\tfinalValue += specialVar[i].value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\thiddenVar.value = finalValue;\r\n\t\t\t}\r\n\t\t}";
     if (!HIKASHOP_PHP5) {
         $doc =& JFactory::getDocument();
     } else {
         $doc = JFactory::getDocument();
     }
     $doc->addScriptDeclaration($js);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:subscription.php


示例9: getLocation

function getLocation($str)
{
    $array_size = intval(substr($str, 0, 1));
    // 拆成的行数
    $code = substr($str, 1);
    // 加密后的串
    $len = strlen($code);
    $subline_size = $len % $array_size;
    // 满字符的行数
    $result = array();
    $deurl = "";
    for ($i = 0; $i < $array_size; $i += 1) {
        if ($i < $subline_size) {
            array_push($result, substr($code, 0, ceil($len / $array_size)));
            $code = substr($code, ceil($len / $array_size));
        } else {
            array_push($result, substr($code, 0, ceil($len / $array_size) - 1));
            $code = substr($code, ceil($len / $array_size) - 1);
        }
    }
    for ($i = 0; $i < ceil($len / $array_size); $i += 1) {
        for ($j = 0; $j < count($result); $j += 1) {
            $deurl = $deurl . "" . substr($result[$j], $i, 1);
        }
    }
    return str_replace("^", "0", urldecode($deurl));
}
开发者ID:surevision,项目名称:node_mpg123_pi,代码行数:27,代码来源:xmu.php


示例10: pc_tag

 /**
  * PC标签中调用数据
  * @param array $data 配置数据
  */
 public function pc_tag($data)
 {
     $siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();
     $r = $this->db->select(array('pos' => $data['pos'], 'siteid' => $siteid));
     $str = '';
     if (!empty($r) && is_array($r)) {
         foreach ($r as $v) {
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '<div id="block_id_' . $v['id'] . '" class="admin_block" blockid="' . $v['id'] . '">';
             }
             if ($v['type'] == '2') {
                 extract($v, EXTR_OVERWRITE);
                 $data = string2array($data);
                 if (!defined('HTML')) {
                     ob_start();
                     include $this->template_url($id);
                     $str .= ob_get_contents();
                     ob_clean();
                 } else {
                     include $this->template_url($id);
                 }
             } else {
                 $str .= $v['data'];
             }
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '</div>';
             }
         }
     }
     return $str;
 }
开发者ID:klj123wan,项目名称:czsz,代码行数:35,代码来源:block_tag.class.php


示例11: get

 public function get()
 {
     $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit;
     if ($data = $this->db->getby_id($id)) {
         if (!($str = S('dbsource_' . $id))) {
             if ($data['type'] == 1) {
                 // 自定义SQL调用
                 $get_db = Loader::model("get_model");
                 $sql = $data['data'] . (!empty($data['num']) ? " LIMIT {$data['num']}" : '');
                 $str = $get_db->query($sql);
             } else {
                 $filepath = APPS_PATH . $data['application'] . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . $data['application'] . '_tag.php';
                 if (file_exists($filepath)) {
                     $yun_tag = Loader::lib($data['application'] . ':' . $data['application'] . '_tag');
                     if (!method_exists($yun_tag, $data['do'])) {
                         exit;
                     }
                     $sql = string2array($data['data']);
                     $sql['do'] = $data['do'];
                     $sql['limit'] = $data['num'];
                     unset($data['num']);
                     $str = $yun_tag->{$data}['do']($sql);
                 } else {
                     exit;
                 }
             }
             if ($data['cache']) {
                 S('tpl_data/dbsource_' . $id, $str, $data['cache']);
             }
         }
         echo $this->_format($data['id'], $str, $data['dis_type']);
     }
 }
开发者ID:hubs,项目名称:yuncms,代码行数:33,代码来源:CallController.php


示例12: buildjs

function buildjs()
{
    $t = $_GET["t"];
    $time = time();
    $MEPOST = 0;
    $cachefile = $GLOBALS["PROGRESS_FILE"];
    $logsFile = $GLOBALS["LOG_FILE"];
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $array = unserialize(@file_get_contents($cachefile));
    $prc = intval($array["POURC"]);
    $title = $tpl->javascript_parse_text($array["TEXT"]);
    if ($prc == 0) {
        echo "\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n}\nsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    $md5file = md5_file($logsFile);
    if ($md5file != $_GET["md5file"]) {
        echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('filename','" . urlencode($_GET["filename"]) . "');\n\t\tXHR.appendData('key','" . urlencode($_GET["key"]) . "');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    if ($prc > 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    if ($prc == 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLayersTabsAllAfter();\n\t\tRTMMailHide();\n\t\tCacheOff();\n\t\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&key={$_GET["key"]}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
    //Loadjs('$page?build-js=yes&t=$t&md5file={$_GET["md5file"]}');
}
开发者ID:articatech,项目名称:artica,代码行数:33,代码来源:squid.update.progress.php


示例13: sn_ube_simulator_decode_replay

function sn_ube_simulator_decode_replay($str_data)
{
    $fleet_id = 0;
    $arr_data_unpacked = explode('!', $str_data);
    foreach ($arr_data_unpacked as $data_piece) {
        if (!$data_piece) {
            continue;
        }
        if ($data_piece == 'A' || $data_piece == 'D') {
            $fleet_type = $data_piece;
            continue;
        }
        $arr_unit_strings = explode(';', $data_piece);
        foreach ($arr_unit_strings as $str_unit_string) {
            if (!$str_unit_string) {
                continue;
            }
            $arr_unit_data = explode(',', $str_unit_string);
            if ($arr_unit_data[1]) {
                $unpacked[$fleet_type][$fleet_id][$arr_unit_data[0]] = intval($arr_unit_data[1]);
            }
        }
        $fleet_id++;
    }
    return $unpacked;
}
开发者ID:divyinfo,项目名称:SuperNova,代码行数:26,代码来源:coe_simulator_helpers.php


示例14: outputContent

 /**
  * Output the content of the resource
  *
  * @param array $options An array of options for the output
  */
 public function outputContent(array $options = array())
 {
     if (empty($options['rpc_type'])) {
         $options['rpc_type'] = 'XML';
     }
     $resourceClass = 'mod' . $options['rpc_type'] . 'RPCResource';
     if (!$this->modx->resource instanceof $resourceClass) {
         $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server class.');
     }
     $this->modx->resource->process();
     $this->modx->resource->_output = $this->modx->resource->_content;
     /* collect any uncached element tags in the content and process them */
     $this->modx->getParser();
     $maxIterations = intval($this->modx->getOption('parser_max_iterations', null, 10));
     $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, false, '[[', ']]', array(), $maxIterations);
     $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, true, '[[', ']]', array(), $maxIterations);
     if (!$this->getServer()) {
         $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server.');
     }
     $this->server->service();
     ob_get_level() && @ob_end_flush();
     while (ob_get_level() && @ob_end_clean()) {
     }
     exit;
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:30,代码来源:modxmlrpcresponse.class.php


示例15: init

 public function init()
 {
     $model = $this->model;
     if (!$this->extra_fields) {
         $this->extra_fields = array();
     }
     if (empty($_POST['id'])) {
         $this->data = $model::model()->findAll(array('order' => 'display_order asc'));
     } else {
         $this->data = array();
         foreach ($_POST['id'] as $i => $id) {
             $item = new $model();
             $item->id = $id;
             $item->name = $_POST['name'][$i];
             $attributes = $item->getAttributes();
             if (array_key_exists('active', $attributes)) {
                 $item->active = isset($_POST['active'][$i]) || intval($id) == 0 ? 1 : 0;
             }
             foreach ($this->extra_fields as $field) {
                 $item->{$field['field']} = $_POST[$field['field']][$i];
             }
             $this->data[] = $item;
         }
     }
     return parent::init();
 }
开发者ID:openeyeswales,项目名称:OpenEyes,代码行数:26,代码来源:GenericAdmin.php


示例16: sendData

 public function sendData(callable $callback)
 {
     $client = new swoole_client(SWOOLE_SOCK_UDP, SWOOLE_SOCK_ASYNC);
     $client->on("connect", function ($cli) {
         $this->isConnect = true;
         $cli->send($this->data);
     });
     $client->on('close', function ($cli) {
         $this->isConnect = false;
     });
     $client->on('error', function ($cli) use($callback) {
         $this->isConnect = false;
         $cli->close();
         call_user_func_array($callback, array('r' => 1, 'key' => $this->key, 'error_msg' => 'conncet error'));
     });
     $client->on("receive", function ($cli, $data) use($callback) {
         $this->isConnect = false;
         $cli->close();
         call_user_func_array($callback, array('r' => 0, 'key' => $this->key, 'data' => $data));
     });
     if ($client->connect($this->ip, $this->port, $this->timeout)) {
         if (intval($this->timeout) > 0) {
             swoole_timer_after(intval($this->timeout) * 1000, function () use($client, $callback) {
                 if ($this->isConnect) {
                     //error_log(__METHOD__." client ===== ".print_r($client,true),3,'/tmp/client.log');
                     $client->close();
                     call_user_func_array($callback, array('r' => 2, 'key' => '', 'error_msg' => 'timeout'));
                 }
             });
         }
     }
 }
开发者ID:learsu,项目名称:php-swoole-framework,代码行数:32,代码来源:UdpTestClient.php


示例17: build

function build()
{
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $unix = new unix();
    $sock = new sockets();
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        die;
    }
    $php = $unix->LOCATE_PHP5_BIN();
    @file_put_contents($pidfile, getmypid());
    progress("{get_system_informations}", 30);
    support_step1();
    progress("{APP_UFDBGUARD}", 40);
    $EnableUfdbGuard = intval($sock->EnableUfdbGuard());
    if ($EnableUfdbGuard == 1) {
        $ufdbguardd = $unix->find_program("ufdbguardd");
        if (is_file($ufdbguardd)) {
            shell_exec("{$php} /usr/share/artica-postfix/exec.squidguard.php --build --force --verbose >/usr/share/artica-postfix/ressources/support/build-ufdbguard.log 2>&1");
        }
    }
    progress("{get_all_logs}", 50);
    support_step2();
    progress("{get_all_logs}", 70);
    export_tables();
    progress("{compressing_package}", 90);
    support_step3();
    progress("{success}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:29,代码来源:exec.support.package.php


示例18: updateObjectsFromWriteResponse

 public static function updateObjectsFromWriteResponse($objectsArray, $response)
 {
     $data = json_decode($response->getRawBody(), true);
     if ($response->getStatus() == 200) {
         $newLastModifiedVersion = $response->getHeader("Last-Modified-Version");
         if (isset($data['success'])) {
             foreach ($data['success'] as $ind => $key) {
                 $i = intval($ind);
                 $object = $objectsArray[$i];
                 $objectKey = $object->get('key');
                 if ($objectKey != '' && $objectKey != $key) {
                     throw new Exception("Item key mismatch in multi-write request");
                 }
                 if ($objectKey == '') {
                     $object->set('key', $key);
                 }
                 $object->set('version', $newLastModifiedVersion);
                 $object->synced = true;
                 $object->writeFailure = false;
             }
         }
         if (isset($data['failed'])) {
             foreach ($data['failed'] as $ind => $val) {
                 $i = intval($ind);
                 $object = $objectsArray[$i];
                 $object->writeFailure = $val;
             }
         }
     } elseif ($response->getStatus() == 204) {
         $objectsArray[0]->synced = true;
     }
 }
开发者ID:jean-lelarge,项目名称:libZotero,代码行数:32,代码来源:Utils.php


示例19: convertToBytes

 private function convertToBytes($memoryLimit)
 {
     if ('-1' === $memoryLimit) {
         return -1;
     }
     $memoryLimit = strtolower($memoryLimit);
     $max = strtolower(ltrim($memoryLimit, '+'));
     if (0 === strpos($max, '0x')) {
         $max = intval($max, 16);
     } elseif (0 === strpos($max, '0')) {
         $max = intval($max, 8);
     } else {
         $max = intval($max);
     }
     switch (substr($memoryLimit, -1)) {
         case 't':
             $max *= 1024;
         case 'g':
             $max *= 1024;
         case 'm':
             $max *= 1024;
         case 'k':
             $max *= 1024;
     }
     return $max;
 }
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:26,代码来源:MemoryDataCollector.php


示例20: unFollow

 /**
  * 取消关注操作
  * @return json 返回操作后的JSON信息数据
  */
 public function unFollow()
 {
     // 安全过滤
     $fid = t($_POST['fid']);
     $res = $this->_follow_model->unFollow($this->mid, intval($fid));
     $this->ajaxReturn($res, $this->_follow_model->getError(), false !== $res);
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:11,代码来源:FollowAction.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP intvalPgSql函数代码示例发布时间:2022-05-15
下一篇:
PHP intl_is_failure函数代码示例发布时间: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