I have a get variable in this format : 0-1499
. Now I need to convert it to a string so that I can explode the variable. For this I tried to convert it to string , but I am not getting any output. Here is the sample code :
$mystring = $_GET['myvars']; //equals to 0-1499;
//$mystring = (string)$mystring;
$mystring = strval($mystring);
$mystring = explode("-",$mystring);
print_r($mystring);
The above print_r()
shows an array Array ( [0] => [1] => 1499 )
. That means it calculates the $mystring
before converted into string. How can I send 0-1499
as whole string to explode
?