php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24250 Shell like 'for arg in [list]' loop
Submitted: 2003-06-18 21:02 UTC Modified: 2003-06-19 00:30 UTC
From: jbreker at sympatico dot ca Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jbreker at sympatico dot ca
New email:
PHP Version: OS:

 

 [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




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-19 00:30 UTC] derick@php.net
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 :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 14:01:33 2024 UTC