Show image with uknown name

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
zenon
Forum Commoner
Posts: 42
Joined: Fri Jan 23, 2009 1:41 pm

Show image with uknown name

Post 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!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Show image with uknown name

Post by Christopher »

glob()


PS - Reason #457 why you should use Unix ... so you know the names of important things. ;)
(#10850)
zenon
Forum Commoner
Posts: 42
Joined: Fri Jan 23, 2009 1:41 pm

Re: Show image with uknown name

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Show image with uknown name

Post by Christopher »

(#10850)
zenon
Forum Commoner
Posts: 42
Joined: Fri Jan 23, 2009 1:41 pm

Re: Show image with uknown name

Post by zenon »

Thank you!! I appreciate it!

Have a nice night and thank you once again!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Show image with uknown name

Post by Christopher »

Next time someone asks about glob() you can handle the question as our new expert! ;) :)
(#10850)
zenon
Forum Commoner
Posts: 42
Joined: Fri Jan 23, 2009 1:41 pm

Re: Show image with uknown name

Post 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!
Post Reply