renaming
Posted: Tue Oct 22, 2002 7:54 pm
if i have file how do i rename it but keep the same file extension
such as image.jpg -> 24039.jpg
such as image.jpg -> 24039.jpg
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$filename = 'image.jpeg';
$newname = '12345'.substr($filename, strrpos($filename,'.'));
echo $newname;
?>