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


PHP ToUpper函数代码示例

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


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

示例1: BasketButtonAction

 public function BasketButtonAction($orderData = array())
 {
     global $APPLICATION;
     if (strlen($_POST["paypalbutton"]) > 0) {
         $url = "https://api-3t." . $this->domain . "paypal.com/nvp";
         $arFields = array("METHOD" => "SetExpressCheckout", "VERSION" => "98.0", "USER" => $this->username, "PWD" => $this->pwd, "SIGNATURE" => $this->signature, "PAYMENTREQUEST_0_AMT" => number_format($orderData["AMOUNT"], 2, ".", ""), "PAYMENTREQUEST_0_CURRENCYCODE" => $this->currency, "RETURNURL" => $this->serverName . $orderData["PATH_TO_ORDER"], "CANCELURL" => $this->serverName . $APPLICATION->GetCurPageParam("paypal=Y&paypal_error=Y", array("paypal", "paypal_error")), "PAYMENTREQUEST_0_PAYMENTACTION" => "Authorization", "PAYMENTREQUEST_0_DESC" => "Order payment for " . $this->serverName, "LOCALECODE" => ToUpper(LANGUAGE_ID), "buttonsource" => "Bitrix_Cart");
         if (!empty($orderData["BASKET_ITEMS"])) {
             $arFields["PAYMENTREQUEST_0_ITEMAMT"] = number_format($orderData["AMOUNT"], 2, ".", "");
             foreach ($orderData["BASKET_ITEMS"] as $k => $val) {
                 $arFields["L_PAYMENTREQUEST_0_NAME" . $k] = $APPLICATION->ConvertCharset($val["NAME"], SITE_CHARSET, "utf-8");
                 $arFields["L_PAYMENTREQUEST_0_AMT" . $k] = number_format($val["PRICE"], 2, ".", "");
                 $arFields["L_PAYMENTREQUEST_0_QTY" . $k] = $val["QUANTITY"];
             }
         }
         $arFields["RETURNURL"] .= (strpos($arFields["RETURNURL"], "?") === false ? "?" : "&") . "paypal=Y";
         $ht = new \Bitrix\Main\Web\HttpClient(array("version" => "1.1"));
         if ($res = $ht->post($url, $arFields)) {
             $result = $this->parseResult($res);
             if (strlen($result["TOKEN"]) > 0) {
                 $url = "https://www." . $this->domain . "paypal.com/webscr?cmd=_express-checkout&token=" . $result["TOKEN"];
                 if ($orderData["ORDER_REQUEST"] == "Y") {
                     return $url;
                 }
                 LocalRedirect($url);
             }
         } else {
             $GLOBALS["APPLICATION"]->ThrowException(GetMessage("PPL_ERROR"), "CSalePaySystemPrePayment_action_error");
             return false;
         }
     }
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:32,代码来源:pre_payment.php

示例2: __construct

 private function __construct()
 {
     global $APPLICATION;
     $this->setDevicewidth($_COOKIE["MOBILE_RESOLUTION_WIDTH"]);
     $this->setDeviceheight($_COOKIE["MOBILE_RESOLUTION_HEIGHT"]);
     $this->setScreenCategory($_COOKIE["MOBILE_SCREEN_CATEGORY"]);
     $this->setPixelratio($_COOKIE["MOBILE_SCALE"]);
     $this->setDevice($_COOKIE["MOBILE_DEVICE"]);
     if ($this->getDevice() == "iPad") {
         $this->setScreenCategory("LARGE");
         if (intval($this->getPixelratio()) == 2) {
             $this->setDevicewidth($_COOKIE["MOBILE_RESOLUTION_WIDTH"] / 2);
             $this->setDeviceheight($_COOKIE["MOBILE_RESOLUTION_HEIGHT"] / 2);
         }
     }
     //detecting OS
     if (array_key_exists("MOBILE_DEVICE", $_COOKIE)) {
         $deviceDetectSource = $_COOKIE["MOBILE_DEVICE"];
     } else {
         $deviceDetectSource = strtolower($_SERVER['HTTP_USER_AGENT']);
     }
     if (strrpos(ToUpper($deviceDetectSource), "IPHONE") > 0 || strrpos(ToUpper($deviceDetectSource), "IPAD") > 0) {
         self::$platform = "ios";
     } else {
         if (strrpos(ToUpper($deviceDetectSource), "ANDROID") > 0 || strrpos(ToUpper($deviceDetectSource), "ANDROID") === 0) {
             self::$platform = "android";
         }
     }
     if (array_key_exists("MOBILE_API_VERSION", $_COOKIE)) {
         self::$apiVersion = intval($_COOKIE["MOBILE_API_VERSION"]);
     } elseif ($APPLICATION->get_cookie("MOBILE_APP_VERSION")) {
         self::$apiVersion = $APPLICATION->get_cookie("MOBILE_APP_VERSION");
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:34,代码来源:mobile.php

示例3: __callStatic

 public static function __callStatic($name, $arguments)
 {
     $name = ToUpper($name);
     switch ($name) {
         case "ADDMESSAGE":
             if ($arguments[1]["APPROVED"] == "Y") {
                 self::actionUpdate($arguments[2], $arguments[2]);
             }
             break;
         case 'ADDTOPIC':
             if ($arguments[1]["APPROVED"] == "Y") {
                 self::actionAdd(array(), $arguments[1]);
             }
             break;
         case 'UPDATETOPIC':
             if ($arguments[1]["APPROVED"] == "N") {
                 self::actionDelete($arguments[1]);
             } else {
                 if (empty($arguments[2]) || $arguments[1]["FORUM_ID"] == $arguments[2]["FORUM_ID"]) {
                     self::actionUpdate(empty($arguments[2]) ? $arguments[1] : $arguments[2], $arguments[1]);
                 } else {
                     self::actionDelete($arguments[2]);
                     self::actionAdd(array(), $arguments[1]);
                 }
             }
             break;
         case 'DELETETOPIC':
             if ($arguments[1]["APPROVED"] == "Y") {
                 self::actionDelete($arguments[1]);
             }
             break;
     }
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:33,代码来源:sitemapforum.php

示例4: departmentGet

 public static function departmentGet($arQuery, $nav = 0)
 {
     CModule::IncludeModule('iblock');
     $arQuery = array_change_key_case($arQuery, CASE_UPPER);
     $arSort = array("LEFT_MARGIN" => 'ASC');
     if (isset($arQuery['SORT'])) {
         $sort = ToUpper($arQuery['SORT']);
         if (in_array($sort, self::$arAllowedDepartmentFields)) {
             $order = isset($arQuery['ORDER']) ? ToUpper($arQuery['ORDER']) : '';
             if ($order != 'DESC') {
                 $order = 'ASC';
             }
             $arSort = array($sort => $order);
         }
     }
     if (isset($arQuery['FILTER']) && is_array($arQuery['FILTER'])) {
         $arQuery = $arQuery['FILTER'];
     }
     $dbRes = CIBlockSection::GetList($arSort, self::prepareDeptData($arQuery), false, self::$arSelectDepartmentFields, self::getNavData($nav));
     $result = array();
     $arFiles = array();
     while ($arDept = $dbRes->NavNext(false)) {
         $result[] = self::getDeptData($arDept);
     }
     return self::setNavData($result, $dbRes);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:26,代码来源:rest.php

示例5: 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);
 }
开发者ID:RosYama,项目名称:rosyama.ru,代码行数:13,代码来源:utils.php

示例6: getFilterColumns

 public static function getFilterColumns()
 {
     $columns = static::getColumns('list');
     foreach ($columns as $code => &$col) {
         $col['DEFAULT'] = in_array($code, array('ID', 'TYPE_ID', 'NAME_' . ToUpper(LANGUAGE_ID), 'SORT'));
     }
     return $columns;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:locationhelper.php

示例7: CheckStrCharsetForJson

function CheckStrCharsetForJson($str)
{
    global $APPLICATION;
    if (ToUpper(SITE_CHARSET) !== 'UTF-8') {
        $str = $APPLICATION->ConvertCharsetArray($str, SITE_CHARSET, 'utf-8');
    }
    return $str;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:8,代码来源:component.php

示例8: update

 public static function update($primary, $data = array())
 {
     if (strlen($data['NAME'])) {
         $data['NAME_UPPER'] = ToUpper($data['NAME']);
     }
     // bitrix to upper
     return parent::update($primary, $data);
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:8,代码来源:location.php

示例9: gs_array_search

 protected function gs_array_search($needle, $haystack)
 {
     foreach ($haystack as $k => $v) {
         if (ToUpper($v) == ToUpper($needle)) {
             return $k;
         }
     }
     return false;
 }
开发者ID:RosYama,项目名称:rosyama.ru,代码行数:9,代码来源:rf_subjects.php

示例10: Format

 public static function Format($data, $charset = 'UTF-8', $entityType = 4, $useBr = 0, $useP = 0, $maxNobr = 3, $quotA = 'laquo raquo', $quotB = 'bdquo ldquo')
 {
     if (ToUpper($charset) != 'UTF-8') {
         $data = $GLOBALS['APPLICATION']->ConvertCharset($data, $charset, 'UTF-8');
     }
     if (!CModule::IncludeModule('webservice')) {
         return ALSTypograf::typograf($data);
     } else {
         return ALSTypograf::artlebedev($data);
     }
 }
开发者ID:rieset,项目名称:bitrix_module_als.typograf,代码行数:11,代码来源:typograf.php

示例11: Fetch

	public function Fetch()
	{
		$r = parent::Fetch();

		if($r)
		{
			if(strlen($r["SITE_URL"])>0)
				$r["URL"] = $r["SITE_URL"];

			if(substr($r["URL"], 0, 1)=="=")
			{
				$events = GetModuleEvents("search", "OnSearchGetURL");
				while ($arEvent = $events->Fetch())
					$r["URL"] = ExecuteModuleEventEx($arEvent, array($r));
			}

			$r["URL"] = str_replace(
				array("#LANG#", "#SITE_DIR#", "#SERVER_NAME#"),
				array($r["DIR"], $r["DIR"], $r["SERVER_NAME"]),
				$r["URL"]
			);
			$r["URL"] = preg_replace("'(?<!:)/+'s", "/", $r["URL"]);

			$r["NAME"] = htmlspecialcharsex($r["TITLE"]);

			$preg_template = "/(^|[^".$this->_arStemFunc["pcre_letters"]."])(".str_replace("/", "\\/", implode("|", array_map('preg_quote', array_keys($this->_arPhrase)))).")/i".BX_UTF_PCRE_MODIFIER;
			if(preg_match_all($preg_template, ToUpper($r["NAME"]), $arMatches, PREG_OFFSET_CAPTURE))
			{
				$c = count($arMatches[2]);
				if(defined("BX_UTF"))
				{
					for($j = $c-1; $j >= 0; $j--)
					{
						$prefix = mb_substr($r["NAME"], 0, $arMatches[2][$j][1], 'latin1');
						$instr  = mb_substr($r["NAME"], $arMatches[2][$j][1], mb_strlen($arMatches[2][$j][0], 'latin1'), 'latin1');
						$suffix = mb_substr($r["NAME"], $arMatches[2][$j][1] + mb_strlen($arMatches[2][$j][0], 'latin1'), mb_strlen($r["NAME"], 'latin1'), 'latin1');
						$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
					}
				}
				else
				{
					for($j = $c-1; $j >= 0; $j--)
					{
						$prefix = substr($r["NAME"], 0, $arMatches[2][$j][1]);
						$instr  = substr($r["NAME"], $arMatches[2][$j][1], strlen($arMatches[2][$j][0]));
						$suffix = substr($r["NAME"], $arMatches[2][$j][1]+strlen($arMatches[2][$j][0]));
						$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
					}
				}
			}
		}

		return $r;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:54,代码来源:title.php

示例12: GetLocationList

	/**
	 * <p>Функция возвращает набор местоположений, связанных с группами местоположений, удовлетворяющих фильтру arFilter.</p>
	 *
	 *
	 *
	 *
	 * @param array $arrayarFilter = Array() Фильтр представляет собой ассоциативный массив, в котором
	 * ключами являются названия параметров записи, а значениями -
	 * условия на значения<br><br> Допустимые ключи: <ul> <li> <b>LOCATION_ID</b> - код
	 * местоположения;</li> <li> <b>LOCATION_GROUP_ID</b> - код группы
	 * местоположений.</li> </ul>
	 *
	 *
	 *
	 * @return CDBResult <p>Возвращается объект класса CDBResult, содержащий ассоциативные
	 * массивы с ключами:</p><table class="tnormal" width="100%"> <tr> <th width="15%">Ключ</th>
	 * <th>Описание</th> </tr> <tr> <td>LOCATION_ID</td> <td>Код местоположения.</td> </tr> <tr>
	 * <td>LOCATION_GROUP_ID</td> <td>Код группы местоположений.</td> </tr> </table><a
	 * name="examples"></a>
	 *
	 *
	 * <h4>Example</h4> 
	 * <pre>
	 * &lt;?
	 * // Выберем все местоположения группы 2
	 * $db_res = CSaleLocationGroup::GetLocationList(array("LOCATION_GROUP_ID"=&gt;2));
	 * while ($ar_res = $db_res-&gt;Fetch())
	 * {
	 *    echo $ar_res["LOCATION_ID"].", ";
	 * }
	 * ?&gt;
	 * </pre>
	 *
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/sale/classes/csalelocationgroup/csalelocationgroup__getlocationlist.56a02620.php
	 * @author Bitrix
	 */
	public static function GetLocationList($arFilter=Array())
	{
		global $DB;
		$arSqlSearch = Array();

		if(!is_array($arFilter))
			$filter_keys = Array();
		else
			$filter_keys = array_keys($arFilter);

		$countFieldKey = count($filter_keys);
		for($i=0; $i < $countFieldKey; $i++)
		{
			$val = $DB->ForSql($arFilter[$filter_keys[$i]]);
			if (strlen($val)<=0) continue;

			$key = $filter_keys[$i];
			if ($key[0]=="!")
			{
				$key = substr($key, 1);
				$bInvert = true;
			}
			else
				$bInvert = false;

			switch(ToUpper($key))
			{
			case "LOCATION_ID":
				$arSqlSearch[] = "LOCATION_ID ".($bInvert?"<>":"=")." ".IntVal($val)." ";
				break;
			case "LOCATION_GROUP_ID":
				$arSqlSearch[] = "LOCATION_GROUP_ID ".($bInvert?"<>":"=")." ".IntVal($val)." ";
				break;
			}
		}

		$strSqlSearch = "";
		$countSqlSearch = count($arSqlSearch);
		for($i=0; $i < $countSqlSearch; $i++)
		{
			$strSqlSearch .= " AND ";
			$strSqlSearch .= " (".$arSqlSearch[$i].") ";
		}

		$strSql =
			"SELECT LOCATION_ID, LOCATION_GROUP_ID ".
			"FROM b_sale_location2location_group ".
			"WHERE 1 = 1 ".
			"	".$strSqlSearch." ";

		$db_res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		return $db_res;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:91,代码来源:location_group.php

示例13: addDataToTable

 function addDataToTable($source = array(), $data = array(), $data_name = "", $dataID = false)
 {
     global $APPLICATION;
     if ($dataID === false) {
         $dataID = 'data' . rand(1, 100000);
     }
     $source['data'][$dataID] = $data;
     if (ToUpper(SITE_CHARSET) !== 'UTF-8') {
         $data_name = $APPLICATION->ConvertCharset($data_name, SITE_CHARSET, 'utf-8');
     }
     $source['names'][$dataID] = (string) $data_name;
     return $source;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:13,代码来源:ajax.php

示例14: AddTableData

function AddTableData($source = array(), $data = array(), $data_name = "", $dataID = false)
{
    global $APPLICATION;
    if ($dataID == false) {
        $dataID = "data" . rand(1, 10000);
    }
    $source["data"][$dataID] = $data;
    if (ToUpper(SITE_CHARSET) != "UTF-8") {
        $data_name = $APPLICATION->ConvertCharset($data_name, SITE_CHARSET, "utf-8");
    }
    $source["names"][$dataID] = $data_name;
    return $source;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:13,代码来源:functions.php

示例15: __GetLocation

 function __GetLocation($location_id)
 {
     static $arDHLUSACountryList;
     $arLocation = CSaleLocation::GetByID($location_id, 'en');
     $dbZipList = CSaleLocation::GetLocationZIP($location_id);
     while ($arZip = $dbZipList->Fetch()) {
         $arLocation['ZIP_LIST'][] = $arZip['ZIP'];
     }
     if (!is_array($arDHLUSACountryList)) {
         require 'dhl_usa/country.php';
     }
     $arLocation['COUNTRY_DHLUSA'] = $arDHLUSACountryList[ToUpper($arLocation['COUNTRY_NAME'])];
     return $arLocation;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:14,代码来源:delivery_dhl_usa.php


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