Jump to content

Changing a filename


DapperDanMan

Recommended Posts

I have the following code to change a filename when I am creating a thumbnail on upload:
[code]
$file = "something.jpg";
$tb_image = explode(".", $file);
$array = array($tb_image[0], 'tb.jpg');
$together = implode("_", $array);
[/code]

I am curious, is there a better way than exploding the name to insert the "_tb" into the middle of the name?

DDM
Link to comment
https://forums.phpfreaks.com/topic/11134-changing-a-filename/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.