String Manipulation using php
<p>I have a string like this </p>

<pre><code>$str=44797675962044781781414912/04/2012
</code></pre>

<ul>
<li>First 12 digit: 447976759620 is the phone number</li>
<li>Next 12 digit: 447817814149 is the server code</li>
</ul>

<p>and rest are the date</p>

<h3>I am trying to get it like  this:</h3>

<pre><code>echo substr($str,0,12).'&lt;br/&gt;';
echo substr($str,12,24).'&lt;br/&gt;';
$tempRest["receivedtime"]=substr($pieces[0],-10);
</code></pre>

<p>Getting this weird out put :</p>

<pre><code>   44797675962
   12/04/2012
   44778691004444781781414912/04/2012
</code></pre>

<p>What can I do. Any help?</p>

<h2>EDITED :</h2>

<h3>Original code :</h3>

<pre><code>  function GetSoapReturnArray() {
 $classmap = array('MyWSDLStructure' =&gt; 'MyComplexDataType');
 $m_wsdl = 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl';
  $m_arr_soapclient = array('trace' =&gt; true, 'exceptions' =&gt; true);


  $soap_client_handle = new SoapClient($m_wsdl, $m_arr_soapclient);
  $soap_result = $soap_client_handle-&gt;peekMessages('telab048', 'Qwerty12', 40, '', 1);;

  $str=NULL;

  foreach ($soap_result as $soapArrayData)
  {
    $pieces = preg_split('/[ ]/', $soapArrayData);

  $str=$pieces[0];
    //echo $str.'&lt;br/&gt;';

    echo substr($str, 0, 12) . '&lt;br /&gt;';
    echo substr($str, 12, 12) . '&lt;br /&gt;';
  }
}


}
  GetSoapReturnArray();
</code></pre>
