I've an array below which I'd like to retrieve each individual values.
[employee] => id=55&name=John&last_name=Smith,
[salary] => 40000,
[bonus] => 5000
I want to extract the first set of data to
$id = "55";
$name = "John";
$last_name = "Smith";
How do I do this?
There's a php function called parse_str which can solve this for you:
$array = array(
'employee' => 'id=55&name=John&last_name=Smith',
'salary' => 40000,
'bonus' => 5000
$employee is now an array of the values from the employee string.
That helps me a lot.
This topic is now closed. New replies are no longer allowed.