I have a string like this
$str=44797675962044781781414912/04/2012
- First 12 digit: 447976759620 is the phone number
- Next 12 digit: 447817814149 is the server code
and rest are the date
I am trying to get it like this:
echo substr($str,0,12).'<br/>';
echo substr($str,12,24).'<br/>';
$tempRest["receivedtime"]=substr($pieces[0],-10);
Getting this weird out put :
44797675962
12/04/2012
44778691004444781781414912/04/2012
What can I do. Any help?
EDITED :
Original code :
function GetSoapReturnArray() {
$classmap = array('MyWSDLStructure' => 'MyComplexDataType');
$m_wsdl = 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl';
$m_arr_soapclient = array('trace' => true, 'exceptions' => true);
$soap_client_handle = new SoapClient($m_wsdl, $m_arr_soapclient);
$soap_result = $soap_client_handle->peekMessages('telab048', 'Qwerty12', 40, '', 1);;
$str=NULL;
foreach ($soap_result as $soapArrayData)
{
$pieces = preg_split('/[ ]/', $soapArrayData);
$str=$pieces[0];
//echo $str.'<br/>';
echo substr($str, 0, 12) . '<br />';
echo substr($str, 12, 12) . '<br />';
}
}
}
GetSoapReturnArray();
$strfrom where? XML?