title: How can i loop through string of phone number and remove the leading zero and replace with country code?
body: <p>How can i loop through string of phone number and remove the leading zero and replace with country code?</p>
  
  <p><strong>Example:</strong></p>
  
  <p>I want to replace each leading zero (0) of the phone numbers with "233";</p>
  
  <pre><code>$pn_box='08064342060,08052031697,08064342060';
  </code></pre>
  
  <p>Though I tried doing it this way but it converts only the first phone number</p>
  
  <pre><code>echo $newNumber = preg_replace('/^0?/', '+'.'233', $pn_num);
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>$pn_box='+2338064342060,2338052031697,2338064456763';
  </code></pre>
  
  <p>Thanks in advance</p>