With the following string:
$string='some text <photo id="id#" /> some text';
Make a substr that if the end of its string is a part of
<photo id="id#" />
then apply an extra chunk to complete
"<photo id="id#" />"
Example:
substr($string,0,15);
result is:
some text <phot
If this happens I need to end up with:
some text <photo id="id#" />
He, can't find the way of doing this. by the way id# is a random numeric value whose length won't exceed 3 chars. If regex is necessary to come up with a function.