#24250 [Opn->WFx]: Shell like 'for arg in [list]' loop
| From: | derick@php.net | Date: | Thu, 19 Jun 2003 05:30:33 +0000 |
| Subject: | #24250 [Opn->WFx]: Shell like 'for arg in [list]' loop | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-42230@lists.php.net to get a copy of this message | ||
ID: 24250
Updated by: derick@php.net
Reported By: jbreker at sympatico dot ca
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
PHP Version: 4.3.2
New Comment:
What's wrong with:
foreach(glob('*.jpg') as $file) {
echo "<a href=\"$file\"><img
src=\"$file\"/></a><br/>";
}
We're a scripting language here, not a shell :)
Previous Comments:
------------------------------------------------------------------------
[2003-06-18 21:02:53] jbreker at sympatico dot ca
Description:
------------
Right now I am executing shell scripts (like the one below) in order to
put pictures up on my site. I would prefer to do this entirely in php
code. I looked at the foreach loop and at some filesystem functions but
I can't see any combination working when you don't know the filename.
sample shell script example code:
for file in *.jpg
do
echo "<a href=\"$file\"><img
src=\"$file\"/></a><br/>"
done
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24250&edit=1