Hi PHP ppl,

I have a directory named cartoons,
it has around 180 files in them ONLY images,
the filenames are 1.jpg, 2.jpg......5.gif, 6.gif etc etc
if you got confused with the above line its basically all the files are
numbered from 1-180 and the file types are mixed JPG and

I have a program that displays each of the cartoons displays a  <-- Prev  *
* *  Next--> link, basicaly theres a hidden field that specifies the current
number and if you click prev its c=c-1 and if your press next its c=c+1, but
I have no idea if the next cartoon is either JPG or GIF and so am displaying
both like so in my code:

<img src=$c.gif>
<img src=$c.jpg>
since only one is valid the other shows an ugly blank image placeholder

Any idea on how i can read the last three letters of the file to determine
if its gif/jpg?

Kindly reply,

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

Reply via email to