本文整理匯總了PHP中CopixUrl::_pathinfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP CopixUrl::_pathinfo方法的具體用法?PHP CopixUrl::_pathinfo怎麽用?PHP CopixUrl::_pathinfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CopixUrl
的用法示例。
在下文中一共展示了CopixUrl::_pathinfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRequestedPathInfo
/**
* Récupère le pathinfo
* <code>
* //Si appelé via http://localhost/copix_3/test.php/stuff/stuff2/stuff3?test=simpletest|
* echo CopixUrl::getRequestedPathInfo ();
* //affiche "/stuff/stuff2/stuff3"
* </code>
* @return string
*/
public static function getRequestedPathInfo()
{
if (self::$_pathinfo === false) {
//following is index.php/mypath/myaction
if (isset($_SERVER['ORIG_PATH_INFO']) || isset($_SERVER['PATH_INFO'])) {
self::$_pathinfo = isset($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : $_SERVER['PATH_INFO'];
$pos = strpos(self::$_pathinfo, self::getRequestedScriptPath() . self::getRequestedScriptName());
if ($pos !== false) {
//under IIS, we may get as PATH_INFO /subdir/index.php/mypath/myaction (wich is incorrect)
self::$_pathinfo = substr(self::$_pathinfo, strlen(self::getRequestedScriptPath() . self::getRequestedScriptName()));
}
} else {
self::$_pathinfo = substr($_SERVER["PHP_SELF"], strlen($_SERVER['SCRIPT_NAME']));
}
}
return self::$_pathinfo;
}