Page 1 of 1

image resize - thumbnail name

Posted: Fri Oct 13, 2006 10:45 am
by psurrena
My question is based on the tutorial at viewtopic.php?t=41743

I want the thumbnail name to be based on the file name but the file name contain .jpg. How would I append "-thumb" four characters in from the end?

Code: Select all

imagejpeg($thumb, "images/". $filename . "-thumb.jpg", 80);
Creates imagename.jpg-thumb.jpg

-Pete

Posted: Fri Oct 13, 2006 10:53 am
by hawleyjr
Check out pathinfo()

Posted: Fri Oct 13, 2006 11:34 am
by psurrena
Is there an opposite to strchr?

Posted: Fri Oct 13, 2006 11:35 am
by hawleyjr
Have you looked in the manual???


http://us3.php.net/manual/en/function.strrchr.php