PHP Array Key & value Question
Posted
by Nano HE
on Stack Overflow
See other posts from Stack Overflow
or by Nano HE
Published on 2010-05-04T14:05:37Z
Indexed on
2010/05/04
14:08 UTC
Read the original article
Hit count: 240
Hi I writed a test code as below.
<?php
$url = 'http://localhost/events/result/cn_index.php?login';
print_r(parse_url($url));
echo parse_url($url, PHP_URL_PATH);
?>
Output
Array ( [scheme] => http [host] => localhost [path] => /events/result/cn_index.php [query] => login ) /events/result/cn_index.php
Now I inserted the line below
echo array[query]; // I want to echo 'login', but failed.
How to the the value of 'login'?
© Stack Overflow or respective owner