note 76449 added to control-structures.foreach
| From: | tquick at pixelated dot com | Date: | Mon, 16 Jul 2007 15:08:52 +0000 |
| Subject: | note 76449 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128616@lists.php.net to get a copy of this message | ||
It is worth noting that the following code works, and has helped me out quite a few times; not to
mention saved time.
This may be obvious to some, but it just dawned on me that the following works:
<?php
foreach($_GET as $x) {
echo "$x <br />";
}
?>
Lets say we named this file, index.php
We put into the address bar:
/index.php?name=x&page=y&other=z
The code would output:
x
y
z
----
Server IP: 208.69.120.35
Probable Submitter: 216.229.90.243
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/76449
Del: integrated -- https://master.php.net/note/delete/76449/integrated
Del: useless -- https://master.php.net/note/delete/76449/useless
Del: bad code -- https://master.php.net/note/delete/76449/bad+code
Del: spam -- https://master.php.net/note/delete/76449/spam
Del: non-english -- https://master.php.net/note/delete/76449/non-english
Del: in docs -- https://master.php.net/note/delete/76449/in+docs
Del: other reasons-- https://master.php.net/note/delete/76449
Reject -- https://master.php.net/note/reject/76449
Search -- https://master.php.net/manage/user-notes.php