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


PHP CString::stripAccent方法代码示例

本文整理汇总了PHP中CString::stripAccent方法的典型用法代码示例。如果您正苦于以下问题:PHP CString::stripAccent方法的具体用法?PHP CString::stripAccent怎么用?PHP CString::stripAccent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CString的用法示例。


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

示例1: __construct

 public function __construct(array $REQUEST = array())
 {
     /**
     Si appel par ligne de commande
         fill global $REQUEST
         ex :    php index.php Train/search gare_deb_heure=0000 gare_date=15/07/2015
                 php index.php import/cron
     TODO url param !!!
     */
     if (count($REQUEST) == 0 && isset($_SERVER["argv"]) && is_array($_SERVER["argv"])) {
         chdir(dirname($_SERVER["SCRIPT_FILENAME"]));
         $inp = $_SERVER["argv"][1];
         $inp = preg_replace("!^/!", "", $inp);
         $_SERVER["PATH_INFO"] = "/" . $inp;
         /*
         $aInp = explode(":", $inp, 2);
         if(isset($aInp[0]) && trim($aInp[0]) !== "") {
             // replace / or \ par _ : Core/Server => Core_Server
             // eg : php index.php test/test:testCmd => test_test:testCmd
             //      php index.php Core/Server:_server => Core_Server:_server
             $aInp[0] = preg_replace("/[\/\\\]/", "_", $aInp[0]);
             $REQUEST["service"] = $aInp[0];
         }
         if(isset($aInp[1]) && trim($aInp[1]) !== "") {
             $REQUEST["request"] = trim($aInp[1]);
         }
         */
         // Add other params to $REQUEST
         for ($ar = 2; $ar < count($_SERVER["argv"]); $ar++) {
             $param = $_SERVER["argv"][$ar];
             $aP = explode("=", $param, 2);
             $REQUEST[$aP[0]] = $aP[1];
         }
     }
     // Apply route mask
     $confRoute = Config::get("route");
     if (!empty($confRoute) && isset($_SERVER["PATH_INFO"])) {
         if (is_array($confRoute)) {
             foreach ($confRoute as $mask => $route) {
                 if (preg_match("!{$mask}!i", $_SERVER["PATH_INFO"])) {
                     $_SERVER["PATH_INFO"] = preg_replace("!{$mask}!i", $route, $_SERVER["PATH_INFO"]);
                     FirePHP::fbLog("info", "Routing to " . $_SERVER["PATH_INFO"]);
                     break;
                 }
             }
         } else {
             FirePHP::fbLog("error", "ROUTE config must be an array of mask/route");
         }
     }
     /**
     Custom made Redirect Url
         eg: index.php/Test/ => Test:main
             index.php/Core/server/info/ => Core_Server:info
             index.php/Test/demo => Test:main(demo)
             index.php/Test/Main/demo => Test:main(demo)
             index.php/Test/Main/demo/id => Test:main(demo, id)
     */
     if (isset($_SERVER["PATH_INFO"]) && !empty($_SERVER["PATH_INFO"])) {
         $url = $this->Parse();
         $service = $url["service"];
         $request = $url["request"];
         // Si url compose de Service/Request/Param1/Param2/...
         if ($service !== null) {
             $REQUEST["service"] = $service;
         }
         if ($service !== null) {
             $REQUEST["request"] = $request;
         }
     }
     //Store standard params
     foreach ($REQUEST as $key => $value) {
         $key = str_replace(" ", "_", $key);
         $key = CString::stripAccent($key);
         // Strip tags on $REQUEST if magic quote active
         if (get_magic_quotes_gpc()) {
             $value = stripslashes($value);
         }
         $this->{$key} = $value;
     }
 }
开发者ID:solofo-ralitera,项目名称:oron,代码行数:80,代码来源:Request.php


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