I have a string tokenNo=12345&securityCode=111&name=Sam
How is it possible to extract the datas and store them into variables as below?
$tokenNo='12345';
$securityCode='111';
$name='Sam';
Please help
Use parse_str:
$string = 'tokenNo=12345&securityCode=111&name=Sam';
parse_str($string);
echo $tokenNo;
echo $securityCode;
echo $name;
Or you can store the entire variables in one array:
$string = 'tokenNo=12345&securityCode=111&name=Sam';
parse_str($string, $array);
print_r($array);