image resize - thumbnail name

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

image resize - thumbnail name

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Check out pathinfo()
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Post by psurrena »

Is there an opposite to strchr?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Have you looked in the manual???


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