note 76062 added to language.variables.predefined

From: Date: Thu, 28 Jun 2007 14:05:56 +0000
Subject: note 76062 added to language.variables.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-128051@lists.php.net to get a copy of this message
theonly_DD32, I refined your function a little bit <?php function long_to_GET($PATH_INFO=''){ /** * This function converts info.php/a/1/b/2/c?d=4 TO * array ( [d] => 4 [a] => 1 [b] => 2 [c] => array ( [d] => 4 ) ) * got this function from http://php.net/GLOBALS **/ if($PATH_INFO=='' && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != ''){ $PATH_INFO = $_SERVER['PATH_INFO']; } if($PATH_INFO != ''){ //Split it out. $tmp = explode('/',$PATH_INFO); //Remove first empty item unset($tmp[0]); //Loop through and apend it into the $_GET superglobal. for($i=1;$i<=count($tmp);$i+=2){ if(strpos($tmp[$i],'?')!==false){ $tmp1 = explode('?',$tmp[$i]); parse_str(isset($tmp1[1])?$tmp1[1]:'',$_GET[$tmp1[0]]); $i--; } else { $_GET[$tmp[$i]] = isset($tmp[$i+1])?$tmp[$i+1]:''; } } } } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 75.180.199.34 ---- Manual Page -- http://www.php.net/manual/en/language.variables.predefined.php Edit -- https://master.php.net/note/edit/76062 Del: integrated -- https://master.php.net/note/delete/76062/integrated Del: useless -- https://master.php.net/note/delete/76062/useless Del: bad code -- https://master.php.net/note/delete/76062/bad+code Del: spam -- https://master.php.net/note/delete/76062/spam Del: non-english -- https://master.php.net/note/delete/76062/non-english Del: in docs -- https://master.php.net/note/delete/76062/in+docs Del: other reasons-- https://master.php.net/note/delete/76062 Reject -- https://master.php.net/note/reject/76062 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128051) next »