|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-18 21:02 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
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 :)