I have the following URL structure:
http://website.com/images/folder1/folder2/123456/x500x1000_2x_ImageName.jpg
I need to remove the crop resolution "x500x1000_2x_" from the image name, like so:
http://website.com/uploads/folder1/folder2/123456/ImageName.jpg
I tried numerous things:
$img = preg_replace('/\[x](\d+)[x](\d+)[_2x_]\.*/', '', $img);
$img = preg_replace('/[x]\d[x]\d[_2x_]\.*/', '', $img);
$img = preg_replace('/\/\[x]+\d+[x]+\d+\D+\d\.*/', '', $img);
I am really not good with preg_replace, can anyone help me please?