Hello ,
I'm trying to split a string using preg_split() ( since split ) is deprected...
I'm trying to split it using '=' sign and to get the GETS variable from a url but I'm getting the error :
"Warning: preg_split() [function.preg-split]: No ending delimiter '=' found in C:"
The code is :
<?php
$request_url = $_SERVER;
//parse the page request and get variables
$parsed_url = explode('&',$request_url );
$page_is = array_shift($parsed_url );
$getVars = array();
foreach($parsed_url as $argument)
{
//split GET vars along '=' symbol to separate variables and values
list($variable,$value) = preg_split("=",$argument);
$getVars[$variable] = $value;
}
//this is a test and we will be removing it later
print "the page you requested is '$page_is'";
print '<br>';
$vars = print_r($getVars,TRUE);
print "The following GET vars were passed to the page:<pre>".$vars."</pre>";
?>