/ Published in: PHP
This will take an url or just the querystring portion and break it out into an array
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Parse out url query string into an associative array * * $qry can be any valid url or just the query string portion. * Will return false if no valid querystring found * * @param $qry String * @return Array */ function queryToArray($qry) { //string must contain at least one = and cannot be in first position $qry = $q['query']; } }else { return false; } $result[$key] = $val; } }