24 lut 2016

Parsowanie adresu uri strony

$urls = array (
'http://kody.wig.pl/file.php?key=9emixire&ampexpires=1456358400&signature=76f289',
'http://kody.wig.pl/file.php?key=9emixire&expires=1456358400&signature=76f289');
$arr_url = parse_url($urls[0]);
parse_str($arr_url['query'], $arr_query);
print_r($arr_url);
print_r($arr_query);

Wynik:

Array
(
[scheme] => http
[host] => kody.wig.pl
[path] => /file.php
[query] => key=9emixire&expires=1456358400&signature=76f289
)
Array
(
[key] => 9emixire
[expires] => 1456358400
[signature] => 76f289
)