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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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: Thu Dec 26 09:01:29 2024 UTC