I am doing a data import from one CMS to another. I have got image callouts in one CMS, for example:
{image id="12321" align="right" crop="square"}
or
{image id="12321" align="left" crop="rectangle"}
Technically speaking, the values in align or crop could be a variety of values, all alphabetic in nature. I would like to take either of these scenarios, and turn them into the following:
[image id="12321" align="VALUEHERE" crop="VALUEHERE"]
Sorry, I should have elaborated earlier. This is part of body copy in an article. I can't just replace the first and last characters :) Also, there are callouts that are similar in nature, str_replace won't work. I was hoping for some preg_replace help, which is why I mentioned regex in the title. I should have elaborated more from the initial question post.
preg_replace()