Zen Cart Logo
Forums / General Questions / Some help please with file name manipulation

Some help please with file name manipulation

Locked

Views: 739

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
12 Aug 2008, 4:29 PM
#1
chalfontgifts avatar

chalfontgifts

Zen Follower

Join Date:
Jun 2007
Posts:
122
Plugin Contributions:
0

Some help please with file name manipulation

Hi

I need to manipulate a file name to transfer images from a suppliers feed.

This is what I start with.

suppliersname.com/prod_images/image_cat41/2681_image1_electric-starter-1.jpg

This will be in the variable $image_in

I want to manipulate this so that it will extract the file name, place an _1 at the end of the file name, but before the .jpg, and add images/ to the beginning of it like ths

images/2681_image1_electric-starter-1_1.jpg

This will then go in the variable name $image_out.

Can anyone give me any idea how this can be done.

Thanks for any help.