My problem is I'm trying modifying a Wordpress plugin (Comic Easel) without complete knowhow of PHP. Anyway, what I wanted to do is make mobile/vertical versions of my comic strip (cause mine is in horizontal format), so I made alternate versions of the comic images, say http://example.com/comic1m.jpg
Now here's the code:
$thumbnail = wp_get_attachment_image_src( $post_image_id, $size, false);
What this does is get the URL of the image attached to a post, and make a variable out of it. For example, $thumbnail would now be:
$thumbnail = "http://example.com/comic1.jpg"
What I want to do is assign another $mthumbnail using wp_get_attachment_image_src like with $thumbnail, except with the m added on at the end (or replace the last 4 characters) so http://example.com/comic1.jpg turns into http://example.com/comic1m.jpg
$thumbnail = "http://example.com/comic1.jpg"
$mthumbnail = "http://example.com/comic1m.jpg"
Another problem is the image URLs could have different lengths and file formats, so I thought that just replacing the last 4 characters is the better solution. If there's a way to code it so that it can tell the file formats apart, remove/replace the strings, and then add the m and file format back that'd be great.