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

PHP len函数代码示例

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

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



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

示例1: path2array_paquet

 public static function path2array_paquet($_path, $lg1, $lg2, $mesure)
 {
     $array_lg = array($lg1, $lg2);
     sort($array_lg);
     $data = Tool_files::file_load($_path);
     $f = Tool_files::csv2array_line($data, "\n");
     $array_paquet = array();
     $tmp = array();
     $flag_vu = false;
     foreach ($f as $line) {
         if (mb_eregi("[:alnum:]", $line)) {
             $tmp[] = trim($line);
         } elseif (len($tmp) > 0) {
             list($dist, $rep) = mb_split(" : ", $tmp[0]);
             list($score, $l1, $l2) = mb_split(" ", $rep);
             $score = trim($score);
             $dist = trim($dist);
             $l1 = trim($l1);
             $l2 = trim($l2);
             if ($dist == $mesure) {
                 if ($l1 == $lg2 and $l2 == $lg1 or $lg1 == $l1 and $lg2 == $l2) {
                     $flag_vu = true;
                     list($str1, $rep1) = self::line2str_rep($tmp[1]);
                     list($str2, $rep2) = self::line2str_rep($tmp[2]);
                     $array_paquet[] = array('score' => $score, $l1 => $rep1, $l2 => $rep2, "str_{$l1}" => $str1, "str_{$l2}" => $str2);
                 }
             } elseif ($flag_vu) {
                 break;
             }
             $tmp = array();
         }
     }
     return $array_paquet;
 }
开发者ID:BGCX261,项目名称:zone-align-svn-to-git,代码行数:34,代码来源:tool_read_log.php


示例2: pad

/**
 * UTF-8 aware alternative to str_pad.
 *
 * $pad_str may contain multi-byte characters.
 *
 * @author     Oliver Saunders <[email protected]>
 * @package    php-utf-8
 * @subpackage functions
 * @see        http://www.php.net/str_pad
 * @uses       utf8_substr
 *
 * @param string $input
 * @param int    $length
 * @param string $pad_str
 * @param int    $type    (same constants as str_pad)
 *
 * @return string
 */
function pad($input, $length, $pad_str = ' ', $type = STR_PAD_RIGHT)
{
    $input_len = len($input);
    if ($length <= $input_len) {
        return $input;
    }
    $pad_str_len = len($pad_str);
    $pad_len = $length - $input_len;
    if ($type == STR_PAD_RIGHT) {
        $repeat_times = ceil($pad_len / $pad_str_len);
        return sub($input . str_repeat($pad_str, $repeat_times), 0, $length);
    }
    if ($type == STR_PAD_LEFT) {
        $repeat_times = ceil($pad_len / $pad_str_len);
        return sub(str_repeat($pad_str, $repeat_times), 0, floor($pad_len)) . $input;
    }
    if ($type == STR_PAD_BOTH) {
        $pad_len /= 2;
        $pad_amount_left = floor($pad_len);
        $pad_amount_right = ceil($pad_len);
        $repeat_times_left = ceil($pad_amount_left / $pad_str_len);
        $repeat_times_right = ceil($pad_amount_right / $pad_str_len);
        $padding_left = sub(str_repeat($pad_str, $repeat_times_left), 0, $pad_amount_left);
        $padding_right = sub(str_repeat($pad_str, $repeat_times_right), 0, $pad_amount_right);
        return $padding_left . $input . $padding_right;
    }
    trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')', E_USER_ERROR);
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:46,代码来源:str_pad.php


示例3: sub_replace

/**
 * UTF-8 aware substr_replace.
 *
 * @package    php-utf-8
 * @subpackage functions
 * @see        http://www.php.net/substr_replace
 * @uses       utf8_strlen
 * @uses       utf8_substr
 *
 * @param string $str
 * @param string $repl
 * @param int    $start
 * @param int    $length
 *
 * @return string
 */
function sub_replace($str, $repl, $start, $length = null)
{
    preg_match_all('/./us', $str, $ar);
    preg_match_all('/./us', $repl, $rar);
    $length = is_int($length) ? $length : len($str);
    array_splice($ar[0], $start, $length, $rar[0]);
    return implode($ar[0]);
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:24,代码来源:substr_replace.php


示例4: add_row

function add_row($hook, $attributes)
{
    $table .= "<tr><td><input type=\"button\" value=\"{$hook}\" onclick=\"pick({$hook})\"></td>";
    for ($i = 0; $i < len($attributes); $i++) {
        $table += "<td>" . $attributes[$i] . "</td>";
    }
    $table .= "</tr>";
}
开发者ID:brentechols34,项目名称:pokebuilder,代码行数:8,代码来源:query.php


示例5: split

/**
 * UTF-8 aware alternative to str_split.
 *
 * Convert a string to an array
 *
 * @package    php-utf-8
 * @subpackage functions
 * @see        http://www.php.net/str_split
 * @uses       utf8_strlen
 *
 * @param string $str       A UTF-8 encoded string
 * @param int    $split_len A number of characters to split string by
 *
 * @return string characters in string reverses
 */
function split($str, $split_len = 1)
{
    if (!preg_match('/^[0-9]+$/', $split_len) || $split_len < 1) {
        return false;
    }
    $len = len($str);
    if ($len <= $split_len) {
        return array($str);
    }
    preg_match_all('/.{' . $split_len . '}|[^\\x00]{1,' . $split_len . '}$/us', $str, $ar);
    return $ar[0];
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:27,代码来源:str_split.php


示例6: istxt

function istxt($str)
{
    $i = 0;
    $str1 = "";
    while ($i < 4) {
        $str1 .= $str[len($str) - $i];
    }
    if ($str1 != "txt.") {
        return 0;
    } else {
        return 1;
    }
}
开发者ID:amira-s,项目名称:etna-projects,代码行数:13,代码来源:redirection.php


示例7: cspn

/**
 * UTF-8 aware alternative to strcspn.
 *
 * Find length of initial segment not matching mask.
 *
 * @package    php-utf-8
 * @subpackage functions
 * @see        http://www.php.net/strcspn
 * @uses       utf8_strlen
 * @uses       utf8_substr
 *
 * @param string  $str
 * @param string  $mask
 * @param integer $start
 * @param integer $length
 *
 * @return integer|null
 */
function cspn($str, $mask, $start = null, $length = null)
{
    if (empty($mask) || strlen($mask) == 0) {
        return null;
    }
    $mask = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\\${1}', $mask);
    if ($start !== null || $length !== null) {
        $str = sub($str, $start, $length);
    }
    preg_match('/^[^' . $mask . ']+/u', $str, $matches);
    if (isset($matches[0])) {
        return len($matches[0]);
    }
    return 0;
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:33,代码来源:strcspn.php


示例8: wordwrap

/**
 * UTF-8 aware alternative to wordwrap.
 *
 * Wraps a string to a given number of characters
 * https://github.com/nicolas-grekas/Patchwork-UTF8
 *
 * @see        http://www.php.net/manual/en/function.wordwrap.php
 *
 * @param string  $str   the input string
 * @param int     $width the column width
 * @param string  $break the line is broken using the optional break parameter
 * @param boolean $cut
 *
 * @return string the given string wrapped at the specified column
 *
 * @package    php-utf-8
 * @subpackage functions
 */
function wordwrap($str, $width = 75, $break = "\n", $cut = false)
{
    $width = (int) $width;
    $str = explode($break, $str);
    $i_len = count($str);
    $result = array();
    $line = '';
    $line_len = 0;
    for ($i = 0; $i < $i_len; ++$i) {
        $words = explode(' ', $str[$i]);
        $line && ($result[] = $line);
        $line_len = len($line);
        $jLen = count($words);
        for ($j = 0; $j < $jLen; ++$j) {
            $w = $words[$j];
            $wLen = len($w);
            if ($line_len + $wLen < $width) {
                if ($j) {
                    $line .= ' ';
                }
                $line .= $w;
                $line_len += $wLen + 1;
            } else {
                if ($j || $i) {
                    $result[] = $line;
                }
                $line = '';
                $line_len = 0;
                if ($cut && $wLen > $width) {
                    $w = split($w);
                    do {
                        $result[] = implode('', array_slice($w, 0, $width));
                        $line = implode('', $w = array_slice($w, $width));
                        $line_len = $wLen -= $width;
                    } while ($wLen > $width);
                    $w = implode('', $w);
                }
                $line = $w;
                $line_len = $wLen;
            }
        }
    }
    $line && ($result[] = $line);
    return implode($break, $result);
}
开发者ID:corpsee,项目名称:php-utf-8,代码行数:63,代码来源:wordwrap.php


示例9: func_redir

function func_redir($line)
{
    $tabtest = array();
    preg_match("/([^>]*) >+ (.*)/", $line, $tabtest);
    if (count($tabtest) != 3) {
        echo "Syntax is wrong\n";
    } else {
        if (is_dir($tabtest[2]) || $tabtest[2][len($tabtest[2]) - 1] == '/') {
            echo "content.php: {$tabtest[2]}: Is a directory\n";
        } else {
            if (file_exists($tabtest[2]) && !is_writable($tabtest[2])) {
                echo "content.php: {$tabtest[2]}: Permission denied\n";
            } else {
                redirection($tabtest);
            }
        }
    }
}
开发者ID:amira-s,项目名称:etna-projects,代码行数:18,代码来源:func_redir.php


示例10: globalize

 /**
  * Global vars
  *
  * @param NCModule $module
  * @param Theme $view
  * @param Translate $lang
  * @return array|\System\Engine\NCBlock[]
  */
 static function globalize(NCModule $module, Theme $view, Translate $lang)
 {
     $view->twig->addFilter(new \Twig_SimpleFilter('ord', function ($order) {
         $cur = Env::$request->get('order');
         if (strpos($cur, $order) > -1) {
             return $cur[0] == '-' ? 'fa-chevron-down' : 'fa-chevron-up';
         }
         return strpos($cur, $order);
     }));
     /**
      * Substr
      */
     $view->twig->addFilter(new \Twig_SimpleFilter('sub', function ($str, $len = 24) {
         if (\len($str) > $len) {
             $str = \cut($str, 0, $len - 3) . '...';
         }
         return $str;
     }));
     /**
      * Long to ip
      */
     $view->twig->addFilter(new \Twig_SimpleFilter('longip', function ($str) {
         return long2ip($str);
     }));
     /**
      * IP to long
      */
     $view->twig->addFilter(new \Twig_SimpleFilter('iplong', function ($str) {
         return ip2long($str);
     }));
     return ['title_prefix' => NCService::load('Application.Settings')->conf->get('title_prefix'), 'lang_code' => $lang->pack, 'ga' => lazy_arr('ga', ['$code' => function () {
         /** @var GA $manager */
         $manager = NCService::load('SocialMedia.GA');
         return $manager->code();
     }])];
 }
开发者ID:Max201,项目名称:nanocore,代码行数:44,代码来源:Module.php


示例11: getRParam

function getRParam($content, $lableStr)
{
    $contentLCase = '';
    $endS = '';
    $i = '';
    $s = '';
    $c = '';
    $isStart = '';
    $startStr = '';
    $isValue = '';
    $content = ' ' . $content . ' ';
    //避免更精准获得值
    $contentLCase = lCase($content);
    $lableStr = lCase($lableStr);
    $endS = mid($content, inStr($contentLCase, $lableStr) + len($lableStr), -1);
    //call echo("ends",ends)
    $isStart = false;
    //是否有开始类型值
    $isValue = false;
    //是否有值
    for ($i = 1; $i <= len($endS); $i++) {
        $s = mid($endS, $i, 1);
        if ($isStart == true) {
            if ($s != '') {
                if ($startStr == '') {
                    $startStr = $s;
                } else {
                    if ($startStr == '"' || $startStr == '\'') {
                        if ($s == $startStr) {
                            $isValue = true;
                            break;
                        }
                    } else {
                        if ($s == ' ' && $c == '') {
                        } else {
                            if ($s == ' ' || $s == '/' || $s == '>') {
                                $isValue = true;
                                break;
                            }
                        }
                    }
                    if ($s != ' ') {
                        $c = $c . $s;
                    }
                }
            }
        }
        if ($s == '=') {
            $isStart = true;
        }
    }
    if ($isValue == false) {
        $c = '';
    }
    $getRParam = $c;
    //call echo("c",c)
    return @$getRParam;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:58,代码来源:2015_Param.php


示例12: JsEncode__

function JsEncode__($s)
{
    if (isNul($s)) {
        $JsEncode__ = '';
        return @$JsEncode__;
    }
    $arr1 = '';
    $arr2 = '';
    $i = '';
    $j = '';
    $c = '';
    $p = '';
    $t = '';
    $arr1 = array(chr(34), chr(92), chr(47), chr(8), chr(12), chr(10), chr(13), chr(9));
    //34|",92|\,47|/,8|,12|,10| ,13| ,9|	,
    $arr2 = array(chr(34), chr(92), chr(47), chr(98), chr(102), chr(110), chr(114));
    //34|",92|\,47|/,98|b,102|f,110|n,114|r,1865|,
    for ($i = 1; $i <= len($s); $i++) {
        $p = true;
        $c = mid($s, $i, 1);
        for ($j = 0; $j <= uBound($arr1); $j++) {
            if ($c == $arr1[$j]) {
                $t = $t . '\\' . $arr2[$j];
                $p = false;
                break;
            }
        }
        if ($p) {
            $t = $t . $c;
        }
    }
    $JsEncode__ = $t;
    return @$JsEncode__;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:34,代码来源:2014_Js.php


示例13: count_attributes


//.........这里部分代码省略.........
                                    }
                                    //if code attribute exists
                                }
                            }
                            //Going to need a count of disbursements and of IF transactions
                            //Then need to test each against a set of criteria
                            /*if ($transaction_type == NULL) {
                                $transaction_type = "Missing";
                                echo "missing";
                              }
                              if ($transaction_type !="D") {
                                echo $id;
                                //die;
                              }*/
                            //Locations
                            //We can have more than one location, but they should add up to 100%
                            $locations = $activity->location;
                            //if (!isset($activities_with_location[$hierarchy])) {
                            //  $activities_with_location[$hierarchy] = 0;
                            //}
                            if (isset($locations) && count($locations) > 0) {
                                $activities_with_location[$hierarchy][] = (string) $activity->{'iati-identifier'};
                                foreach ($locations as $location) {
                                    if (isset($location->coordinates)) {
                                        $activities_with_coordinates[$hierarchy][] = (string) $activity->{'iati-identifier'};
                                    }
                                    if (isset($location->administrative)) {
                                        if (isset($location->administrative->attributes()->adm1)) {
                                            $adm1 = string($location->administrative->attributes()->adm1);
                                        }
                                        if (isset($location->administrative->attributes()->adm2)) {
                                            $adm2 = string($location->administrative->attributes()->adm2);
                                        }
                                        if (isset($adm1) && len($adm1) > 0 || isset($adm2) && len($adm2) > 0) {
                                            $activities_with_adminstrative[$hierarchy][] = (string) $activity->{'iati-identifier'};
                                        }
                                    }
                                }
                            }
                            //Sector
                            $sectors = $activity->sector;
                            if (isset($sectors) && count($sectors) > 0) {
                                //$activities_with_sector[$hierarchy][] = (string)$activity->{'iati-identifier'};
                                foreach ($sectors as $sector) {
                                    if (!isset($sector->attributes()->vocabulary)) {
                                        $activities_sector_assumed_dac[$hierarchy][] = (string) $activity->{'iati-identifier'};
                                    } elseif ((string) $sector->attributes()->vocabulary == "DAC") {
                                        //echo "DAC";
                                        $activities_sector_declared_dac[$hierarchy][] = (string) $activity->{'iati-identifier'};
                                    }
                                }
                            }
                            //Last-updated-datetime
                            $last_updated = $activity->attributes()->{'last-updated-datetime'};
                            $last_updated = strtotime($last_updated);
                            if (!isset($most_recent[$hierarchy])) {
                                $most_recent[$hierarchy] = 0;
                            }
                            if ($last_updated > $most_recent[$hierarchy]) {
                                $most_recent[$hierarchy] = $last_updated;
                            }
                            //Activity dates
                            $activity_dates = $activity->{"activity-date"};
                            //if (count($activity_dates) > 0) {
                            //if ($activity_dates !=NULL) {
                            //  $activities_with_at_least_one[$hierarchy]++;
开发者ID:rolfkleef,项目名称:IATI-Public-Validator,代码行数:67,代码来源:transparency_calculations.php


示例14: formatting

function formatting($content, $action)
{
    $i = '';
    $endStr = '';
    $s = '';
    $c = '';
    $labelName = '';
    $startLabel = '';
    $endLabel = '';
    $endLabelStr = '';
    $nLevel = '';
    $isYes = '';
    $parentLableName = '';
    $nextLableName = '';
    //下一个标题名称
    $isA = '';
    //是否为A链接
    $isTextarea = '';
    //是否为多行输入文本框
    $isScript = '';
    //脚本语言
    $isStyle = '';
    //Css层叠样式表
    $isPre = '';
    //是否为pre
    $startLabel = '<';
    $endLabel = '>';
    $nLevel = 0;
    $action = '|' . $action . '|';
    //层级
    $isA = false;
    $isTextarea = false;
    $isScript = false;
    $isStyle = false;
    $isPre = false;
    $content = replace(replace($content, vbCrlf(), chr(10)), vbTab(), '    ');
    for ($i = 1; $i <= len($content); $i++) {
        $s = mid($content, $i, 1);
        $endStr = mid($content, $i, -1);
        if ($s == '<') {
            if (inStr($endStr, '>') > 0) {
                $s = mid($endStr, 1, inStr($endStr, '>'));
                $i = $i + len($s) - 1;
                $s = mid($s, 2, len($s) - 2);
                if (right($s, 1) == '/') {
                    $s = PHPTrim(left($s, len($s) - 1));
                }
                $endStr = right($endStr, len($endStr) - len($s) - 2);
                //最后字符减去当前标签  -2是因为它有<>二个字符
                //注意之前放在labelName下面
                $labelName = mid($s, 1, inStr($s . ' ', ' ') - 1);
                $labelName = lCase($labelName);
                //call echo("labelName",labelName)
                if ($labelName == 'a') {
                    $isA = true;
                } else {
                    if ($labelName == '/a') {
                        $isA = false;
                    } else {
                        if ($labelName == 'textarea') {
                            $isTextarea = true;
                        } else {
                            if ($labelName == '/textarea') {
                                $isTextarea = false;
                            } else {
                                if ($labelName == 'script') {
                                    $isScript = true;
                                } else {
                                    if ($labelName == '/script') {
                                        $isScript = false;
                                    } else {
                                        if ($labelName == 'style') {
                                            $isStyle = true;
                                        } else {
                                            if ($labelName == '/style') {
                                                $isStyle = false;
                                            } else {
                                                if ($labelName == 'pre') {
                                                    $isPre = true;
                                                } else {
                                                    if ($labelName == '/pre') {
                                                        $isPre = false;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                $endLabelStr = $endLabel;
                $nextLableName = getHtmlLableName($endStr, 0);
                //不为压缩HTML
                if (inStr($action, '|ziphtml|') == false && $isPre == false) {
                    if ($isA == false) {
                        if (inStr('|a|strong|u|i|s|script|', '|' . $labelName . '|') == false && '/' . $labelName != $nextLableName && inStr('|/a|/strong|/u|/i|/s|/script|', '|' . $nextLableName . '|') == false) {
                            $endLabelStr = $endLabelStr . chr(10);
                        }
//.........这里部分代码省略.........
开发者ID:313801120,项目名称:AspPhpCms,代码行数:101,代码来源:2015_Formatting.php


示例15: webStat

function webStat($folderPath)
{
    $dateTime = '';
    $content = '';
    $splStr = '';
    $thisUrl = '';
    $goToUrl = '';
    $caiShu = '';
    $c = '';
    $fileName = '';
    $co = '';
    $ie = '';
    $xp = '';
    $goToUrl = serverVariables('HTTP_REFERER');
    $thisUrl = 'http://' . serverVariables('HTTP_HOST') . serverVariables('SCRIPT_NAME');
    $caiShu = serverVariables('QUERY_STRING');
    if ($caiShu != '') {
        $thisUrl = $thisUrl . '?' . $caiShu;
    }
    $goToUrl = @$_REQUEST['GoToUrl'];
    $thisUrl = @$_REQUEST['ThisUrl'];
    $co = @$_GET['co'];
    $dateTime = now();
    $content = serverVariables('HTTP_USER_AGENT');
    $content = replace($content, 'MSIE', 'Internet Explorer');
    $content = replace($content, 'NT 5.0', '2000');
    $content = replace($content, 'NT 5.1', 'XP');
    $content = replace($content, 'NT 5.2', '2003');
    $splStr = aspSplit($content . ';;;;', ';');
    $ie = $splStr[1];
    $xp = aspTrim($splStr[2]);
    if (right($xp, 1) == ')') {
        $xp = mid($xp, 1, len($xp) - 1);
    }
    $c = '来访' . $goToUrl . vbCrlf();
    $c = $c . '当前:' . $thisUrl . vbCrlf();
    $c = $c . '时间:' . $dateTime . vbCrlf();
    $c = $c . 'IP:' . getIP() . vbCrlf();
    $c = $c . 'IE:' . getBrType('') . vbCrlf();
    $c = $c . 'Cookies=' . $co . vbCrlf();
    $c = $c . 'XP=' . $xp . vbCrlf();
    $c = $c . 'Screen=' . @$_REQUEST['screen'] . vbCrlf();
    //屏幕分辨率
    $c = $c . '用户信息=' . serverVariables('HTTP_USER_AGENT') . vbCrlf();
    //用户信息
    $c = $c . '-------------------------------------------------' . vbCrlf();
    //c=c & "CaiShu=" & CaiShu & vbcrlf
    $fileName = $folderPath . Format_Time(now(), 2) . '.txt';
    CreateAddFile($fileName, $c);
    $c = $c . vbCrlf() . $fileName;
    $c = replace($c, vbCrlf(), '\\n');
    $c = replace($c, '"', '\\"');
    //Response.Write("eval(""var MyWebStat=\""" & C & "\"""")")
    $splxx = '';
    $nIP = '';
    $nPV = '';
    $ipList = '';
    $s = '';
    $ip = '';
    //判断是否显示回显记录
    if (@$_REQUEST['stype'] == 'display') {
        $content = getFText($fileName);
        $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf());
        $nIP = 0;
        $nPV = 0;
        $ipList = '';
        foreach ($splxx as $key => $s) {
            if (inStr($s, '当前:') > 0) {
                $s = vbCrlf() . $s . vbCrlf();
                $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0));
                $nPV = $nPV + 1;
                if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) {
                    $ipList = $ipList . $ip . vbCrlf();
                    $nIP = $nIP + 1;
                }
            }
        }
        Rw('document.write(\'网长统计 | 今日IP[' . $nIP . '] | 今日PV[' . $nPV . '] \')');
    }
    $webStat = $c;
    return @$webStat;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:82,代码来源:2015_APGeneral.php


示例16: getInChain

function getInChain($httpUrl, $urlList)
{
    $splStr = '';
    $url = '';
    $c = '';
    $urlLCase = '';
    $isHandle = '';
    $splStr = aspSplit($urlList, vbCrlf());
    $urlList = '';
    foreach ($splStr as $key => $url) {
        if ($url != '') {
            $urlLCase = lCase($url);
            if (left($urlLCase, 1) != '#' && left($urlLCase, 11) != 'javascript:') {
                if (inStr(vbCrlf() . $urlList . vbCrlf(), vbCrlf() . $url . vbCrlf()) == false) {
                    $url = fullHttpUrl($httpUrl, $url);
                    $isHandle = isSonWebSite($url, $httpUrl);
                    if ($isHandle == true) {
                        $urlList = $urlList . $url . vbCrlf();
                    }
                }
            }
        }
    }
    if ($urlList != '') {
        $urlList = left($urlList, len($urlList) - 2);
    }
    $getInChain = $urlList;
    return @$getInChain;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:29,代码来源:URL.php


示例17: getHandleWebHtmlLink

function getHandleWebHtmlLink($RootPath, $content)
{
    $startStr = '';
    $endStr = '';
    $ImgList = '';
    $splStr = '';
    $c = '';
    $CssUrl = '';
    $NewCssUrl = '';
    $CssStr = '';
    $startStr = '<link ';
    $CssStr = '';
    $endStr = '>';
    $ImgList = GetArray($content, $startStr, $endStr, false, false);
    //Call RwEnd(ImgList)
    $splStr = aspSplit($ImgList, '$Array$');
    foreach ($splStr as $key => $CssUrl) {
        if ($CssUrl != '' && inStr(lCase($CssUrl), 'stylesheet') > 0) {
            //获得Css加强版,改于20141125
            $CssUrl = lCase(replace(replace(replace($CssUrl, '"', ''), '\'', ''), '>', ' ')) . ' ';
            $startStr = 'href=';
            $endStr = ' ';
            if (inStr($CssUrl, $startStr) > 0 && inStr($CssUrl, $endStr) > 0) {
                $CssUrl = StrCut($CssUrl, $startStr, $endStr, 2);
            }
            $NewCssUrl = handleHttpUrl($CssUrl);
            if (inStr($NewCssUrl, '/') > 0) {
                $NewCssUrl = mid($NewCssUrl, inStrRev($NewCssUrl, '/') + 1, -1);
            }
            if (lCase($NewCssUrl) != 'common.css' && lCase($NewCssUrl) != 'public.css') {
                $NewCssUrl = $RootPath . $NewCssUrl;
                $CssStr = $CssStr . '<link href="' . $NewCssUrl . '" rel="stylesheet" type="text/css" />' . vbCrlf();
            }
        }
    }
    if ($CssStr != '') {
        $CssStr = left($CssStr, len($CssStr) - 2);
    }
    $getHandleWebHtmlLink = $CssStr;
    return @$getHandleWebHtmlLink;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:41,代码来源:2014_Css.php


示例18: handleSplitArray

function handleSplitArray($content, $SplOneType, $SplTowType)
{
    $SplA = '';
    $SplB = '';
    $splStr = '';
    $splxx = '';
    $i = '';
    $s = '';
    $c = '';
    $j = '';
    $t = '';
    $SplType = '';
    $SplType = '[|Array|]';
    $splStr = aspSplit($content, $SplOneType);
    for ($i = 0; $i <= uBound($splStr); $i++) {
        if ($splStr[$i] != '') {
            $splxx = aspSplit($splStr[$i], $SplTowType);
            $SplA = $SplA . $splxx[0] . $SplType;
            $SplB = $SplB . $splxx[1] . $SplType;
        }
    }
    if ($SplA != '') {
        $SplA = left($SplA, len($SplA) - len($SplType));
    }
    if ($SplB != '') {
        $SplB = left($SplB, len($SplB) - len($SplType));
    }
    $SplA = aspSplit($SplA, $SplType);
    $SplB = aspSplit($SplB, $SplType);
    $splStr[uBound($SplA)][uBound($SplB)];
    for ($i = 0; $i <= uBound($SplA); $i++) {
        $splStr[$i][0] = $SplA[$i];
        $splStr[$i][1] = $SplB[$i];
    }
    $handleSplitArray = $splStr;
    return @$handleSplitArray;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:37,代码来源:2014_Array.php


示例19: len

	  </td><td class="blank">&nbsp;[smallfont]<a href="showtopic.php?threadid=' . $a_thread['thread_id'] . '&boardid=' . $a_thread['board_id'] . '">' . len($a_thread['thread_topic']) . '</a>[smallfontend]
	  ' . ($a_thread['deleted'] == 1 && P_SHOWDELETED ? '&nbsp;<img src="templates/' . $style['styletemplate'] . '/images/saved_no.gif" width="10" height="10" border="0" />' : '') . '</td>
	  <td class="blank" style="text-align:right">[smallfont]' . $a_thread['thread_views'] . '[smallfontend]</td>
	  </tr>';
    $i++;
}
mysql_free_result($r_thread);
unset($a_thread);
// Letzte 10 Posts
$r_post = db_query("SELECT\n     thread_topic, thread_id, last_post_id, last_act_time, board_id\n FROM " . $pref . "thread WHERE board_id IN (" . $show_boards . ") " . (P_SHOWDELETED ? "" : "AND deleted='0'") . " ORDER BY last_act_time DESC LIMIT 0, 10");
$i = 1;
$data['last10posts'] = '';
while ($a_post = db_result($r_post)) {
    $data['last10posts'] .= '<tr bgcolor="' . ($i % 2 == 0 ? '[CellA]' : '[CellB]') . '"><td class="blank" width="10" style="text-align:right">
	  [smallfont]' . $i . '[smallfontend]
	  </td><td class="blank">&nbsp;[smallfont]<a href="showtopic.php?threadid=' . $a_post['thread_id'] . '&boardid=' . $a_post['board_id'] . '#p' . $a_post['last_post_id'] . '">' . len($a_post['thread_topic']) . '</a>[smallfontend]</td>
	  <td class="blank" style="text-align:right">[smallfont]' . datum($a_post['last_act_time']) . '[smallfontend]</td>
	  </tr>';
    $i++;
}
mysql_free_result($r_post);
unset($a_post);
// letze 12 Monate
$month = date("m", $board_time);
$year = date("Y", $board_time);
$monatsname = array(" ", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
$monate = array();
$monate[] = array($monatsname[intval($month)] . '&nbsp;' . $year, mktime(0, 0, 0, intval($month), 1, $year), mktime(0, 0, -1, intval($month) + 1, 1, $year));
for ($i = 0; $i < 12; $i++) {
    $month--;
    if ($month == 0) {
开发者ID:BackupTheBerlios,项目名称:thwc,代码行数:31,代码来源:stat.php


示例20: add_if_not_exists3

function add_if_not_exists3($what, $where, $group)
{
    # digerinden farkı: istenilen my.cnf grubu altına ekler.
    # especially for config files with [groups], such as my.cnf
    $filearr = @file($where, FILE_IGNORE_NEW_LINES);
    # do not include \n character in strings
    if (!$filearr) {
        echo "cannot open file, trying to setup: ({$where})\n";
        $fp = fopen($where, 'w');
        fclose($fp);
        $filearr = file($where);
    }
    # once group bulunacak:
    $keys = array_keys($filearr, $group);
    if (len($keys) == 0) {
        #echo "#group not found, add group&item \n";
        $filearr[] = $group;
        $filearr[] = $what;
    } else {
        $group_pos = $keys[0];
        #echo "# group found.. at $group_pos \n";
        $i = $group_pos + 1;
        # start searching token from next line, until next group name
        $found = False;
        while ($i < len($filearr) and $filearr[$i][0] != '[' and $filearr[$i] != $what) {
            $i++;
        }
        if ($i >= len($filearr)) {
            #echo "#dosya sonu geldi, sonuna ekle..\n";
            $filearr[] = $what;
        } elseif ($filearr[$i] == $what) {
            #echo "# found, just return \n";
            return;
        } else {
            array_splice($filearr, $i, 0, $what);
            #echo "# insert item here: $i  \n";
        }
    }
    arraytofile($where, $filearr, "\n");
}
开发者ID:rohdoor,项目名称:ehcp,代码行数:40,代码来源:install_lib.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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