If I have a string such as this "Hello | I'm Ben"
and I want to edit the second section, I can use PHP explode like this
$newstring = explode("|","Hello | I'm Ben");
Once that data has been edited to something new, for example:
$newstring[1] = "I'm john";
How can I implode the string to once again be "Hello | I'm John"
?
PHP's implode function returns Hello I'm John
however it does not put the delimiters back in.
So, is there a way to implode this string and put the |
between the two exploded sections of the string?