<?php $url = "http://abc.com.tw/?mod=store&func=style_show&SR_NO=AIAE81"; $urls = parse_url($url); parse_str($urls['query'], $queries); /* 結果: parse_url = Array ( [scheme] => http [host] => abc.com.tw [path] => / [query] => mod=store&func=style_show&SR_NO=AIAE81 ) */ echo "<pre>parse_url = " . print_r($urls, TRUE). "</pre>"; /* 結果: parse_str = Array ( [mod] => store [func] => style_show [SR_NO] => AIAE81 ) */ echo "<pre>parse_str = " . print_r($queries, TRUE). "</pre>"; ?>
全站熱搜