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


PHP StrToLower函数代码示例

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


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

示例1: parse_headers

 private static function parse_headers($raw, $first)
 {
     #
     # first, deal with folded lines
     #
     $raw_lines = explode("\r\n", $raw);
     $lines = array();
     $lines[] = array_shift($raw_lines);
     foreach ($raw_lines as $line) {
         if (preg_match("!^[ \t]!", $line)) {
             $lines[count($lines) - 1] .= ' ' . trim($line);
         } else {
             $lines[] = trim($line);
         }
     }
     #
     # now split them out
     #
     $out = array($first => array_shift($lines));
     foreach ($lines as $line) {
         list($k, $v) = explode(':', $line, 2);
         $out[StrToLower($k)] = trim($v);
     }
     return $out;
 }
开发者ID:mirosalem,项目名称:slack-mixpanel-integration,代码行数:25,代码来源:http.php

示例2: jeRobot

function jeRobot()
{
    //(funkce převzata z http://seo.nawebu.cz/200301/0287.html)
    $robot = 0;
    $agent_test = " " . StrToLower($_SERVER["HTTP_USER_AGENT"]);
    if (!StrPos($agent_test, "mozilla") && !StrPos($agent_test, "opera") && !StrPos($agent_test, "links") && !StrPos($agent_test, "lynx") && !StrPos($agent_test, "icab") && !StrPos($agent_test, "reqwireless")) {
        $robot = 1;
    } else {
        if (StrPos($agent_test, "@")) {
            $robot = 1;
        }
        if (StrPos($agent_test, "search")) {
            $robot = 1;
        }
        if (StrPos($agent_test, "crawl")) {
            $robot = 1;
        }
        if (StrPos($agent_test, "bot")) {
            $robot = 1;
        }
        if (StrPos($agent_test, "spider")) {
            $robot = 1;
        }
        if (StrPos($agent_test, "jeeves")) {
            $robot = 1;
        }
    }
    return $robot;
}
开发者ID:GE3,项目名称:GE3,代码行数:29,代码来源:statistiky.funkce.php

示例3: title2pagename

 public static function title2pagename($text)
 {
     $znaky = array('á' => 'a', 'é' => 'e', 'ě' => 'e', 'í' => 'i', 'ó' => 'o', 'ú' => 'u', 'ů' => 'u', 'ý' => 'y', 'ž' => 'z', 'š' => 's', 'č' => 'c', 'ř' => 'r', 'Á' => 'A', 'É' => 'E', 'Ě' => 'E', 'Í' => 'I', 'Ó' => 'O', 'Ú' => 'U', 'Ů' => 'U', 'Ý' => 'Y', 'Ž' => 'Z', 'Š' => 'S', 'Č' => 'C', 'Ř' => 'R');
     $return = strtr($text, $znaky);
     $return = Str_Replace(" ", "", $return);
     //smaze mezery
     $return = StrToLower($return);
     //velká písmena nahradí malými.
     return $return;
 }
开发者ID:re1la2pse,项目名称:tajemstvi_maserny,代码行数:10,代码来源:MassagesModel.php

示例4: Get_Active_Extensions

 function Get_Active_Extensions()
 {
     $arr_extension = array();
     foreach ((array) get_option('active_plugins') as $plugin_file) {
         $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file);
         if (StrPos(StrToLower($plugin_data['Author']), 'dennis hoppe') !== False) {
             $arr_extension[$plugin_file] = $plugin_data;
         }
     }
     return $arr_extension;
 }
开发者ID:rtgibbons,项目名称:bya.org,代码行数:11,代码来源:contribution.php

示例5: process_dir

function process_dir($pngs, $dir, &$map)
{
    $dh = opendir("{$pngs}/{$dir}");
    while ($file = readdir($dh)) {
        if (preg_match('!^tile_z0_(\\d\\d)_(\\d\\d)\\.png$!', $file, $m)) {
            $key = StrToLower($dir);
            $map[$key]["{$m['1']}-{$m['2']}"] = "{$pngs}/{$dir}/{$file}";
        }
    }
    closedir($dh);
}
开发者ID:rushgun,项目名称:World-of-MapCraft,代码行数:11,代码来源:4_recombine.php

示例6: useragent_decode

	function useragent_decode($ua){

		#
		# a list of user agents, in order we'll match them.
		# e.g. we put chrome before safari because chrome also
		# claims it is safari (but the reverse is not true)
		#

		$agents = array(
			'chrome',
			'safari',
			'konqueror',
			'firefox',
			'netscape',
			'opera',
			'msie',
		);

		$engines = array(
			'webkit',
			'gecko',
			'trident',
		);

		$ua = StrToLower($ua);
		$out = array();

		$temp = useragent_match($ua, $agents);
		$out['agent']		= $temp['token'];
		$out['agent_version']	= $temp['version'];

		$temp = useragent_match($ua, $engines);
		$out['engine']		= $temp['token'];
		$out['engine_version']	= $temp['version'];


		#
		# safari does something super annoying, putting the version in the
		# wrong place like: "Version/5.0.1 Safari/533.17.8"
		#

		if ($out['agent'] == 'safari'){
			$temp = useragent_match($ua, array('version'));
			if ($temp['token']) $out['agent_version'] = $temp['version'];
		}


		return $out;
	}
开发者ID:power7714,项目名称:glitch-mash,代码行数:49,代码来源:lib_useragent.php

示例7: get_files

 function get_files($directory)
 {
     $arr_file = (array) Glob($directory . '{,.}*', GLOB_BRACE);
     $sort_order = array();
     foreach ($arr_file as $index => $file) {
         $path = RealPath($file);
         if (!Is_File($path)) {
             unset($arr_file[$index]);
         } else {
             $arr_file[$index] = $path;
             $sort_order[$index] = StrToLower($file);
         }
     }
     Array_Multisort($sort_order, $arr_file);
     return $arr_file;
 }
开发者ID:RichyVN,项目名称:RST-Intranet,代码行数:16,代码来源:updates.php

示例8: CleanUpElem

function CleanUpElem(&$elem_name, &$cfg_file, &$template)
{
    // Fixes HEX strings to look like 0xABCDEF12345 rather than 0Xabc or 0xaf
    if (Preg_Match("/(0x)([a-fA-F0-9]+)/i", $elem_name, $matches)) {
        $elem_name = Preg_Replace("/(0x)([a-fA-F0-9]+)/i", "0x" . StrToUpper($matches[2]), $elem_name);
    }
    print "    Cleaning up elem '{$elem_name}'\n";
    $cfg_elem = FindConfigElem($cfg_file, $elem_name);
    $cfg_elem = array_change_key_case($cfg_elem, CASE_LOWER);
    $new_elem = array();
    $last_label = 0;
    foreach ($template as $indice => $line) {
        if (Preg_Match('/\\[Label=([[:alnum:][:space:][:punct:]]+)\\]/', $line, $matches)) {
            if ($last_label) {
                unset($new_elem[$last_label]);
            }
            $matches[1] = Preg_Replace("/%s/i", " ", $matches[1]);
            $line = "//{$matches[1]}";
            if ($indice > 1) {
                $line = "\n\t{$line}";
            }
            $last_label = $line;
            $new_elem[$line] = array("");
            continue;
        } else {
            $property = StrToLower($line);
            if ($cfg_elem[$property]) {
                $new_elem[$line] = $cfg_elem[$property];
                unset($cfg_elem[$property]);
                $last_label = 0;
            }
        }
    }
    if (Count($cfg_elem) > 0) {
        $new_elem["\n\t//Custom Values"] = array("");
        // Lines not in the template go at the end as custom values
        foreach ($cfg_elem as $key => $value) {
            $new_elem[$key] = $value;
        }
    }
    if ($last_label) {
        unset($new_elem[$last_label]);
    }
    return $new_elem;
}
开发者ID:polserver,项目名称:poltools,代码行数:45,代码来源:cfgformat.php

示例9: process_dir

function process_dir($pngs, $dir, &$map)
{
    $files = array();
    $dh = opendir("{$pngs}/{$dir}");
    while ($file = readdir($dh)) {
        if (preg_match('!^(.*?)_?(\\d\\d)_(\\d\\d)\\.png$!', $file, $m)) {
            $key = StrToLower($dir . '__' . $m[1]);
            $map[$key]["{$m['2']}-{$m['3']}"] = "{$pngs}/{$dir}/{$file}";
            $files[] = $file;
        }
    }
    closedir($dh);
    # make preview
    $out = "";
    foreach ($files as $file) {
        $out .= "<img src=\"{$file}\" style=\"border: 1px solid red\" >\n";
    }
    $fh = fopen("{$pngs}/{$dir}/preview.htm", 'w');
    fwrite($fh, $out);
    fclose($fh);
}
开发者ID:rushgun,项目名称:World-of-MapCraft,代码行数:21,代码来源:2_combine.php

示例10: generate

 static function generate($depth = False)
 {
     # Get current Filter string
     $filter = RawUrlDecode(Get_Query_Var('filter'));
     if (!empty($filter)) {
         $str_filter = $filter;
     } elseif (Is_Singular()) {
         $str_filter = StrToLower(Get_The_Title());
     } else {
         $str_filter = '';
     }
     # Explode Filter string
     $arr_current_filter = empty($str_filter) ? array() : PReg_Split('/(?<!^)(?!$)/u', $str_filter);
     Array_UnShift($arr_current_filter, '');
     $arr_filter = array();
     # This will be the function result
     $filter_part = '';
     # Check if we are inside a taxonomy archive
     $taxonomy_term = Is_Tax() ? Get_Queried_Object() : Null;
     foreach ($arr_current_filter as $filter_letter) {
         $filter_part .= $filter_letter;
         $arr_available_filters = self::getFilters($filter_part, $taxonomy_term);
         if (Count($arr_available_filters) <= 1) {
             break;
         }
         $active_filter_part = MB_SubStr(Implode($arr_current_filter), 0, MB_StrLen($filter_part) + 1);
         $arr_filter_line = array();
         foreach ($arr_available_filters as $available_filter) {
             $arr_filter_line[$available_filter] = (object) array('filter' => MB_StrToUpper(MB_SubStr($available_filter, 0, 1)) . MB_SubStr($available_filter, 1), 'link' => Post_Type::getArchiveLink($available_filter, $taxonomy_term), 'active' => $active_filter_part == $available_filter, 'disabled' => False);
         }
         $arr_filter[] = $arr_filter_line;
         # Check filter depth limit
         if ($depth && Count($arr_filter) >= $depth) {
             break;
         }
     }
     # Run a filter
     $arr_filter = Apply_Filters('glossary_prefix_filter_links', $arr_filter, $depth);
     return $arr_filter;
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:40,代码来源:class.prefix-filter.php

示例11: rTrim

 $Data = $Upload['Data'];
 #---------------------------------------------------------------------------
 if ($gZip = @GzInflate(SubStr($Upload['Data'], 10))) {
     #-------------------------------------------------------------------------
     echo "Файл базы данных является сжатым файлом gzip\n";
     #-------------------------------------------------------------------------
     $Data = $gZip;
 } else {
     echo "Файл базы данных не является сжатым файлом gzip\n";
 }
 #---------------------------------------------------------------------------
 $File = rTrim($Upload['Name'], '.gz');
 #---------------------------------------------------------------------------
 $File = PathInfo($File);
 #---------------------------------------------------------------------------
 switch (StrToLower($File['extension'])) {
     case 'xml':
         #-----------------------------------------------------------------------
         $Data = String_XML_Parse($Data);
         if (Is_Exception($Data)) {
             return SPrintF('Ошибка чтения базы данных: (%s)', $Data->String);
         }
         #-----------------------------------------------------------------------
         break;
     case 'serialize':
         #-----------------------------------------------------------------------
         $Data = UnSerialize($Data);
         if (!$Data) {
             return 'Ошибка чтения базы данных';
         }
         #-----------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Import.comp.php

示例12: select_country

 public static function select_country()
 {
     $id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
     $id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = StrToLower(Substr(chop($id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424[0]), 0, 2));
     $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = "44";
     if (strlen($id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424) > 0) {
         $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = SmsVariables::$countryPrefix[$id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424];
     }
     return $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078;
 }
开发者ID:mirzavu,项目名称:clothfarm,代码行数:10,代码来源:smsController.php

示例13: array

     }
 }
 // USER PROPERIES
 $arResult["UserPropertiesMain"] = array("SHOW" => "N", "DATA" => array());
 $arResult["UserPropertiesContact"] = array("SHOW" => "N", "DATA" => array());
 $arResult["UserPropertiesPersonal"] = array("SHOW" => "N", "DATA" => array());
 if (count($arParams["USER_PROPERTY_MAIN"]) > 0 || count($arParams["USER_PROPERTY_CONTACT"]) > 0 || count($arParams["USER_PROPERTY_PERSONAL"]) > 0) {
     $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", $arResult["User"]["ID"], LANGUAGE_ID);
     foreach ($arUserFields as $fieldName => $arUserField) {
         //echo "<pre>".print_r($arUserField, true)."</pre>";
         $arUserField["EDIT_FORM_LABEL"] = StrLen($arUserField["EDIT_FORM_LABEL"]) > 0 ? $arUserField["EDIT_FORM_LABEL"] : $arUserField["FIELD_NAME"];
         $arUserField["EDIT_FORM_LABEL"] = htmlspecialcharsEx($arUserField["EDIT_FORM_LABEL"]);
         $arUserField["~EDIT_FORM_LABEL"] = $arUserField["EDIT_FORM_LABEL"];
         $arUserField["PROPERTY_VALUE_LINK"] = "";
         if (in_array($arUserField["FIELD_NAME"], $arParams["SONET_USER_PROPERTY_SEARCHABLE"])) {
             $arUserField["PROPERTY_VALUE_LINK"] = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($arUserField["FIELD_NAME"]) . "=#VALUE#";
         } elseif ($bIntranet) {
             $arUserField['SETTINGS']['SECTION_URL'] = $arParams["PATH_TO_CONPANY_DEPARTMENT"];
         }
         if (in_array($fieldName, $arParams["USER_PROPERTY_MAIN"])) {
             $arResult["UserPropertiesMain"]["DATA"][$fieldName] = $arUserField;
         }
         if (in_array($fieldName, $arParams["USER_PROPERTY_CONTACT"])) {
             $arResult["UserPropertiesContact"]["DATA"][$fieldName] = $arUserField;
         }
         if (in_array($fieldName, $arParams["USER_PROPERTY_PERSONAL"])) {
             $arResult["UserPropertiesPersonal"]["DATA"][$fieldName] = $arUserField;
         }
     }
     if (count($arResult["UserPropertiesMain"]["DATA"]) > 0) {
         $arResult["UserPropertiesMain"]["SHOW"] = "Y";
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例14: getHttpResponse

function getHttpResponse($res, $strRequest)
{
    fputs($res, $strRequest);
    $bChunked = False;
    while (($line = fgets($res, 4096)) && $line != "\r\n") {
        if (@preg_match("/Transfer-Encoding: +chunked/i", $line)) {
            $bChunked = True;
        } elseif (@preg_match("/Content-Length: +([0-9]+)/i", $line, $regs)) {
            $length = $regs[1];
        }
    }
    $strRes = "";
    if ($bChunked) {
        $maxReadSize = 4096;
        $length = 0;
        $line = FGets($res, $maxReadSize);
        $line = StrToLower($line);
        $strChunkSize = "";
        $i = 0;
        while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) {
            $strChunkSize .= $line[$i];
            $i++;
        }
        $chunkSize = hexdec($strChunkSize);
        while ($chunkSize > 0) {
            $processedSize = 0;
            $readSize = $chunkSize > $maxReadSize ? $maxReadSize : $chunkSize;
            while ($readSize > 0 && ($line = fread($res, $readSize))) {
                $strRes .= $line;
                $processedSize += StrLen($line);
                $newSize = $chunkSize - $processedSize;
                $readSize = $newSize > $maxReadSize ? $maxReadSize : $newSize;
            }
            $length += $chunkSize;
            $line = FGets($res, $maxReadSize);
            $line = FGets($res, $maxReadSize);
            $line = StrToLower($line);
            $strChunkSize = "";
            $i = 0;
            while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) {
                $strChunkSize .= $line[$i];
                $i++;
            }
            $chunkSize = hexdec($strChunkSize);
        }
    } elseif ($length) {
        $strRes = fread($res, $length);
    } else {
        while ($line = fread($res, 4096)) {
            $strRes .= $line;
        }
    }
    return $strRes;
}
开发者ID:notfound48,项目名称:dockerBitrix,代码行数:54,代码来源:bitrix_server_test.php

示例15: fix_case_inner

 function fix_case_inner($m)
 {
     $data = StrToLower($m[2]);
     $data = preg_replace_callback('/(^|[^\\w\\s\';,\\-])(\\s*)([a-z])/', create_function('$m', 'return $m[1].$m[2].StrToUpper($m[3]);'), $data);
     return $m[1] . $data . $m[3];
 }
开发者ID:kartikeyap,项目名称:lib_filter,代码行数:6,代码来源:lib_filter.php


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