- substr: documentation ( source)
- strrpos: documentation ( source)
<?php
$x = strrpos('test/bild.jpg','/');
$x = '';
$x = $x? $x++ : '';
$folder = substr('test/bild.jpg',0,$x);
$oldname = substr('test/bild.jpg',$x);
echo 'folder: '.$folder.' oldname:'.$oldname.' newname: '.$newname;