我有一个这样的字符串
$str=44797675962044781781414912/04/2012
- 前 12 位:447976759620 是电话号码
- 接下来的 12 位:447817814149 是服务器代码
休息是日期
我试图这样得到它:
echo substr($str,0,12).'<br/>';
echo substr($str,12,24).'<br/>';
$tempRest["receivedtime"]=substr($pieces[0],-10);
得到这个奇怪的输出:
44797675962
12/04/2012
44778691004444781781414912/04/2012
我能做些什么。有什么帮助吗?
编辑:
原始代码:
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();