after having seen this repeated several times, can't we use parse_url() instead ?