clay1 Posted March 12, 2010 Share Posted March 12, 2010 I need to take a string and separate it into a set of variables or an associative array &Accepted=1&Accepted_msg=Warning%20dialer%5Fsource%5Fid%20is%200&error=0&Error_desc= The fields are delimited by & I'd like to get that to be something like: $accepted = 1 $accepted_message = "warning dialer source..' $error_desc = Link to comment https://forums.phpfreaks.com/topic/195063-parse-string-into-variables/ Share on other sites More sharing options...
wildteen88 Posted March 12, 2010 Share Posted March 12, 2010 You could use parse_str, example $str = 'Accepted=1&Accepted_msg=Warning%20dialer%5Fsource%5Fid%20is%200&error=0&Error_desc='; parse_str($str, $output); echo '<pre>'.print_r($outout, true).'</pre>'; Link to comment https://forums.phpfreaks.com/topic/195063-parse-string-into-variables/#findComment-1025387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.