I have a php system that uploads images and suffixes their files names with -med -slider etc dependant on what size the image is. However only one of the image filenames get saved to the database, so when I want to display an image and call the filename from the database, I get something like,
filename-med.jpg how can I change that so I can replace -med with -slider? is this possible? I am no good at regex and I assume I would have to use that?
use str_replace() like
str_replace( '-med', '-slider', $file_name )