filelist=inventory all files in directory "./"

for file in filelist: // walk a listing of many items
    IF filetype in "gif, jpg, png" {
        echo '<img src="./'.file.'"><P>'
// notice that is a 'singlequote' immedately followed by a "doublequote".

Something like this. In python I would write something like:

import string, glob
files=glob.glob("./*.*") # files is a list variable (a 1 dimensional addressable array) for file in files: # for each cell in files do this doblock: if str.split(file,'.')[1] in "gif","jpg","png"): #if the file type is in a list of acceptable types, print '<img src="./'+file+'"><P>' # print out the material to return surrounding # the file name

On 4/5/2012 10:34 PM, Tommy Pham wrote:
On Thu, Apr 5, 2012 at 7:26 PM, Kirk Bailey<kbai...@howlermonkey.net>  wrote:
Now ai am still a novice at p[hp, how can I do this ?

Have you read any book on PHP?  even the official from PHP.net?  Learn
the tool so you know how to use it, efficiently.  Otherwise how do you
know if the tool can do what you want...  What you're asking for ATM
is someone to write the code for you which is not how it works.  You
need to provide some code, or even pseudo code at least...


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to