Page 1 of 1

Show image with uknown name

Posted: Mon Mar 30, 2009 11:33 am
by zenon
Hello.

I have a folder with many images with different names, for example 123_456_789_***_***.bmp
The "123", "456", "789" are values that i get from a database and the "***" can be different characters, that are different for each image.
I want to show these images but i can't find a way to 'search' in the name of the image, in order to find "***" characters and use it.

For example:

Code: Select all

echo "<img src='images/".$id1 ."_" .$id2 . "_" . $id3 . "_" .*** . "_" . *** . ".bmp' >";


Is there a way to solve this problem?

Thanks a lot!

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 12:27 pm
by Christopher
glob()


PS - Reason #457 why you should use Unix ... so you know the names of important things. ;)

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 12:43 pm
by zenon
arborint wrote:glob()


PS - Reason #457 why you should use Unix ... so you know the names of important things. ;)
Thank you so much!

Can you give me an example of using it please?

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 12:44 pm
by Christopher

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 12:48 pm
by zenon
Thank you!! I appreciate it!

Have a nice night and thank you once again!

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 3:59 pm
by Christopher
Next time someone asks about glob() you can handle the question as our new expert! ;) :)

Re: Show image with uknown name

Posted: Mon Mar 30, 2009 4:09 pm
by zenon
arborint wrote:Next time someone asks about glob() you can handle the question as our new expert! ;) :)
Hehe, :)
Your help was very effective! You saved me much time!

Good night and thanks again!