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);
print_r() shows an array
Array (  =>  => 1499 ). That means it calculates the
$mystring before converted into string. How can I send
0-1499 as whole string to
I have a get variable in this format : 0-1499
When you grab this variable from the URL say..
$var = $_GET['id'];
This will be eventually converted to a string and you don't need to worry about it.
FYI : The above illustration used the code which you provided in the question. I didn't code anything extra.