I'm trying to figure out how to put matched part of a string to the end of the string in php.
For example, let's say that we have string like this:
"<span>Foo</span> rest of the string"
At final, I'd like to obtain this:
"rest of the string Foo"
Code:
$string = "<span>Foo</span> rest of the string";
//$str = preg_replace("/<span>(.*?)<\/span>/","$1",$string);
I know that matched part is represented by $1 but I could not find a way to put it to the end.