I got 1000 of filename with different file extension in my database table (.jpg / .bmp) How to strip that 3 letters at the end and then display it as .gif
I think I need to use substr, but I dont know how to count 3 letters from Right.
strlen($string) - 3;
This will give you the length of the string minus the 3 characters. You can then use this value in your substr().
$blah = substr($filename, 0, -3);