本文整理汇总了PHP中ToLower函数的典型用法代码示例。如果您正苦于以下问题:PHP ToLower函数的具体用法?PHP ToLower怎么用?PHP ToLower使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ToLower函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetCategorySequence
public function GetCategorySequence($CODE)
{
if (self::$CategoryIB <= 0 || !$CODE) {
return array();
}
$arCategoryListXML = $this->GetCategoryList();
$arCategoryList = array();
foreach ($arCategoryListXML as $arCategory) {
$arCategoryList[$arCategory["ID"]] = $arCategory;
}
$arSequnce = array("CATEGORY_1" => false, "CATEGORY_2" => false);
$CODE = ToUpper($CODE);
$arFullSequence = array();
while (array_key_exists($CODE, $arCategoryListXML)) {
array_unshift($arFullSequence, ToLower($CODE));
if ($arCategoryListXML[$CODE]["IBLOCK_SECTION_ID"] > 0 && $arCategoryList[$arCategoryListXML[$CODE]["IBLOCK_SECTION_ID"]]) {
$CODE = ToUpper($arCategoryList[$arCategoryListXML[$CODE]["IBLOCK_SECTION_ID"]]["CODE"]);
} else {
break;
}
}
if (array_key_exists(0, $arFullSequence)) {
$arSequnce["CATEGORY_1"] = $arFullSequence[0];
}
if (count($arFullSequence) > 1) {
$arSequnce["CATEGORY_2"] = end($arFullSequence);
}
$arSequnce["FULL"] = $arFullSequence;
return $arSequnce;
}
示例2: CSearchStatistic
function CSearchStatistic($phrase = "", $tags = "")
{
$phrase = ToLower(trim($phrase, " \t\n\r"));
if ($l = strlen($phrase)) {
if ($l > 250) {
$p = strrpos($phrase, ' ');
if ($p === false) {
$this->_phrase = substr($phrase, 0, 250);
} else {
$this->_phrase = substr($phrase, 0, $p);
}
} else {
$this->_phrase = $phrase;
}
} else {
$this->_phrase = false;
}
$arTags = tags_prepare($tags);
if (count($arTags)) {
asort($arTags);
$this->_tags = implode(", ", $arTags);
} else {
$this->_tags = false;
}
$this->_session_id = bitrix_sessid();
if (isset($_SESSION["SESS_SESSION_ID"])) {
$this->_stat_sess_id = intval($_SESSION["SESS_SESSION_ID"]);
}
}
示例3: GetStatusInfo
function GetStatusInfo($string)
{
switch (ToLower(trim($string))) {
case "прибыл":
case "позднее прибытие":
case "приземлился":
$result["CODE"] = "L";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_L");
break;
case "задержан":
$result["CODE"] = "D";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_D");
break;
case "":
$result["CODE"] = "P";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_P");
break;
case "отправлен":
$result["CODE"] = "F";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_F");
break;
case "отменен":
$result["CODE"] = "C";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_C");
break;
default:
$result["CODE"] = "";
$result["NAME"] = htmlspecialchars($string);
}
$result["~NAME"] = htmlspecialchars($string);
return $result;
}
示例4: CleanURL
public static function CleanURL($URL)
{
if (false !== ($pos = strpos($URL, '?')))
{
$query = substr($URL, $pos+1);
$URL = substr($URL, 0, $pos);
$arQuery = explode('&', $query);
$arExcludedParams = array('clear_cache', 'clear_cache_session', 'back_url_admin', 'back_url', 'backurl', 'login', 'logout', 'compress');
foreach ($arQuery as $key => $param)
{
if (false !== ($pos = strpos($param, '=')))
{
$param_name = ToLower(substr($param, 0, $pos));
if (
substr($param_name, 0, 7) == 'freetrix_'
|| substr($param_name, 0, 5) == 'show_'
|| in_array($param_name, $arExcludedParams)
)
{
unset($arQuery[$key]);
}
}
}
if (count($arQuery) > 0)
{
$URL .= '?'.implode('&', $arQuery);
}
}
return $URL;
}
示例5: GetStatusInfo
function GetStatusInfo($string)
{
switch (ToLower(trim($string))) {
case "прибыл":
$result["CODE"] = "L";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_L");
break;
case "задержан":
case "задерживается":
$result["CODE"] = "D";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_D");
break;
case "":
$result["CODE"] = "P";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_P");
break;
case "вылетел":
$result["CODE"] = "F";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_F");
break;
case "отменен":
$result["CODE"] = "C";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_C");
break;
case "регистрация":
$result["CODE"] = "R";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_R");
break;
default:
$result["CODE"] = "";
$result["NAME"] = htmlspecialchars($string);
}
$result["~NAME"] = htmlspecialchars($string);
return $result;
}
示例6: getTypes
public static function getTypes($params = array('LANGUAGE_ID' => LANGUAGE_ID))
{
if (!is_array($params)) {
$params = array();
}
if (!isset($params['LANGUAGE_ID'])) {
$params['LANGUAGE_ID'] = LANGUAGE_ID;
}
$result = array();
$lang = ToLower($params['LANGUAGE_ID']);
$langMapped = static::mapLanguage($lang);
$res = \Bitrix\Sale\Location\TypeTable::getList(array('select' => array('*', 'TNAME' => 'NAME.NAME', 'TLANGUAGE_ID' => 'NAME.LANGUAGE_ID'), 'order' => array('SORT' => 'asc', 'NAME.NAME' => 'asc')));
while ($item = $res->fetch()) {
if (!isset($result[$item['CODE']])) {
$result[$item['CODE']] = array('CODE' => $item['CODE'], 'ID' => $item['ID'], 'NAME' => array());
}
$result[$item['CODE']]['NAME'][$item['TLANGUAGE_ID']] = $item['TNAME'];
}
foreach ($result as $code => &$data) {
if ((string) $data['NAME'][$lang] != '') {
$name = $data['NAME'][$lang];
} else {
if ((string) $data['NAME'][$langMapped] != '') {
$name = $data['NAME'][$langMapped];
} else {
$name = $data['NAME']['en'];
}
}
$data['NAME_CURRENT'] = $name;
}
return $result;
}
示例7: GetStatusInfo
function GetStatusInfo($string)
{
switch (ToLower(trim($string))) {
case "прилетел":
$result["CODE"] = "L";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_L");
break;
case "не вылетел":
$result["CODE"] = "D";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_D");
break;
case "-":
$result["CODE"] = "P";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_P");
break;
case "вылетел":
$result["CODE"] = "F";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_F");
break;
case "отменен":
$result["CODE"] = "C";
$result["NAME"] = GetMessage("AIRPORT_BOARD_STATUS_C");
break;
default:
$result["CODE"] = "";
$result["NAME"] = "";
}
$result["~NAME"] = htmlspecialchars($string);
return $result;
}
示例8: CapitalizeFirst
/**
* Делает первую букву каждого слова заглавной.
* @param string $string
* @return string
*/
public static function CapitalizeFirst($string)
{
$string = explode(' ', $string);
foreach ($string as &$s) {
$s = ToUpper(substr($s, 0, 1)) . ToLower(substr($s, 1));
}
return implode(' ', $string);
}
示例9: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/report/install/db/" . ToLower($DB->type) . "/uninstall.sql");
}
UnRegisterModule("report");
return true;
}
示例10: CheckReg
function CheckReg()
{
global $RegLogin, $RegPass, $RegPass2, $RegName, $RegEmail;
global $Errors, $Lang, $CLang;
$RegLogin = ToLower($RegLogin);
if (CheckSymb_($RegLogin)) {
$Errors[] = $Lang['SymbErr'];
return;
}
if (CheckSymb_($RegPass)) {
$Errors[] = $Lang['SymbErr'];
return;
}
if (!$RegLogin) {
$Errors[] = $Lang['MustFillLogin'];
return;
}
if (!$RegPass) {
$Errors[] = $Lang['MustFillPass'];
return;
}
if (!$RegName) {
$Errors[] = $Lang['MustFillName'];
return;
}
if (!$RegEmail) {
$Errors[] = $Lang['MustFillEmail'];
return;
}
if ($RegPass != $RegPass2) {
$Errors[] = $Lang['PassNotPass2'];
return;
}
if (strlen($RegLogin) < 3) {
$Errors[] = $Lang['LoginTooShort'];
return;
}
if (strlen($RegLogin) > 64) {
$Errors[] = $Lang['LoginTooLong'];
return;
}
if (strlen($RegPass) < 3) {
$Errors[] = $Lang['PassTooShort'];
return;
}
if (strlen($RegPass) > 64) {
$Errors[] = $Lang['PassTooLong'];
return;
}
if (!ValidMail($RegEmail)) {
$Errors[] = $Lang['MustFillCorrEmail'];
return;
}
NextStep();
}
示例11: decode
public function decode($data)
{
$res = json_decode($data, true);
self::checkException();
// PHP<5.3.3 returns no error for JSON_ERROR_UTF8 and some other ones
if ($res === null && ToLower($data) != 'null') {
self::throwException(self::JSON_ERROR_UNKNOWN);
}
if (!Application::getInstance()->isUtfMode()) {
$res = self::unConvertData($res);
}
return $res;
}
示例12: cleanUp
public static function cleanUp()
{
$dbConnection = Main\HttpApplication::getConnection();
try {
$dbConnection->query('drop table ' . static::getTableName());
$allowedTypes = array('REGION', 'SUBREGION', 'CITY', 'VILLAGE', 'STREET');
foreach ($allowedTypes as $type) {
//$dbConnection->query('drop table b_sale_loc_wc_'.ToLower($type)); // here replace according to map: TYPE_CODE => TABLE_ID
$dbConnection->query('truncate table b_sale_loc_wc_' . ToLower($type));
}
} catch (\Bitrix\Main\DB\SqlQueryException $e) {
}
}
示例13: UnInstallDB
public function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$errors = false;
if(!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y")
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".self::MODULE_ID."/install/db/".ToLower($DB->type)."/uninstall.sql");
if($errors !== false)
throw new \Exception(implode("<br>", $errors));
UnRegisterModule(self::MODULE_ID);
return true;
}
示例14: _cnVerifyFileField
function _cnVerifyFileField($value, $arConf)
{
if (!empty($arConf['MAX_FILE_SIZE']) && $value['size'] > $arConf['MAX_FILE_SIZE']) {
return 'FILE_SIZE';
}
if (!empty($arConf['ALLOWED_FILE_TYPES'])) {
$ext = ToLower(end(explode('.', $value['name'])));
$arValidExt = explode(',', ToLower($arConf['ALLOWED_FILE_TYPES']));
if (!in_array($ext, $arValidExt)) {
return 'FILE_TYPE';
}
}
return true;
}
示例15: cleanUpData
public static function cleanUpData()
{
$dbConnection = Main\HttpApplication::getConnection();
Helper::dropTable(static::getTableName());
$binary = ToLower($dbConnection->getType()) == 'mysql' ? 'binary' : '';
// http://bugs.mysql.com/bug.php?id=34096
// ORACE: OK, MSSQL: OK
Main\HttpApplication::getConnection()->query("create table " . static::getTableName() . " (\n\n\t\t\tID " . Helper::getSqlForDataType('int') . " not null " . Helper::getSqlForAutoIncrement() . " primary key,\n\t\t\tWORD " . Helper::getSqlForDataType('varchar', 50) . " " . $binary . " not null,\n\t\t\tPOSITION " . Helper::getSqlForDataType('int') . " default '0'\n\t\t)");
Helper::addAutoIncrement(static::getTableName());
// only for ORACLE
Helper::createIndex(static::getTableName(), 'TMP', array('WORD'), true);
Helper::dropTable(static::getTableNameWord2Location());
// ORACLE: OK, MSSQL: OK
Main\HttpApplication::getConnection()->query("create table " . static::getTableNameWord2Location() . " (\n\n\t\t\tLOCATION_ID " . Helper::getSqlForDataType('int') . " not null,\n\t\t\tWORD_ID " . Helper::getSqlForDataType('int') . " not null,\n\n\t\t\tprimary key (LOCATION_ID, WORD_ID)\n\t\t)");
Helper::dropTable(static::getTableNamePositionTemporal());
$dbConnection->query("create table " . static::getTableNamePositionTemporal() . " (\n\t\t\tWORD_ID " . Helper::getSqlForDataType('int') . " not null,\n\t\t\tPOSITION " . Helper::getSqlForDataType('int') . " default '0'\n\t\t)");
}