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