Re: image inventoryer

From: Date: Fri, 06 Apr 2012 03:02:29 +0000
Subject: Re: image inventoryer
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-317470@lists.php.net to get a copy of this message
ok. <?php 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: #!/usr/bin/python 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<kbailey@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... HTH, Tommy


« previous php.general (#317470) next »