就像是:
$query = explode('&', $_SERVER['QUERY_STRING']);$params = array();foreach( $query as $param ){ // prevent notice on explode() if $param has no '=' if (strpos($param, '=') === false) $param += '='; list($name, $value) = explode('=', $param, 2); $params[urldepre($name)][] = urldepre($value);}
给你:
array( 'ctx_ver' => array('Z39.88-2004'), 'rft_id' => array('info:oclcnum/1903126', 'http://www.biodiversitylibrary.org/bibliography/4323'), 'rft_val_fmt' => array('info:ofi/fmt:kev:mtx:book'), 'rft.genre' => array('book'), 'rft.btitle' => array('At last: a Christmas in the West Indies.'), 'rft.place' => array('London'), 'rft.pub' => array('Macmillan and co.'), 'rft.aufirst' => array('Charles'), 'rft.aulast' => array('Kingsley'), 'rft.au' => array('Kingsley, Charles'), 'rft.pages' => array('1-352'), 'rft.tpages' => array('352'), 'rft.date' => array('1871'))
由于总是有可能重复一个URL参数,因此最好总是具有数组,而不是仅对那些预期它们的参数进行重复。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)