Assuming a URL of www.domain.org?x=1&y=2&z=3
, what would be a smart method to separate out the query elements of a URL in PHP without using GET or REQUEST?
$url = parse_url($url);
echo $url[fragment];
I don't think it's possible to return query parts separately, is it? From what I can tell, the query will just say x=1&y=2&z=3
, but please let me know if I am wrong. Otherwise, what would you do to parse the $url[query]
?
Fragment should be Query instead. Sorry for the confusion; I am learning!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…