0

That's OK. I'll have a little play with the data and see what comes up. I get this with the code I supplied:

44797672146744781781414929/02/2012 16:43:30SMS0 ATE0 AT+CMGS=+447817814149 
Array
(
    [0] => 44797672146744781781414929/02/2012 16:43:30SMS0 ATE0 AT+CMGS=+447817814149 
    [1] => 447976721467447817814149
    [2] => 29/02/2012
    [3] => 16:43:30
    [4] =>  ATE0 AT+CMGS=+447817814149 
)
44797672147044781781414929/02/2012 16:47:06SMS0 bonjour
Array
(
    [0] => 44797672147044781781414929/02/2012 16:47:06SMS0 bonjour
    [1] => 447976721470447817814149
    [2] => 29/02/2012
    [3] => 16:47:06
    [4] =>  bonjour
)
44797672146744781781414929/02/2012 16:49:29SMS0
Array
(
    [0] => 44797672146744781781414929/02/2012 16:49:29SMS0
    [1] => 447976721467447817814149
    [2] => 29/02/2012
    [3] => 16:49:29
    [4] => 
)

Edited by diafol: n/a

0

i think i found out whats the problem is, its preg_match that is not working because its not sorting out anything i just double checked it by commenting out preg_match still get the same numbers. just viewed the source code so here is the format
output = 44797672146744781781414929/02/2012 16:43:30SMS0 ATE0 AT+CMGS=+447817814149

html format :

<messagerx><sourcemsisdn>447976721467</sourcemsisdn><destinationmsisdn>447817814149</destinationmsisdn><receivedtime>29/02/2012 16:43:30</receivedtime><bearer>SMS</bearer><messageref>0</messageref><message>
ATE0

AT+CMGS=+447817814149

hope the html format helps

Edited by moroccanplaya: n/a

0

Wait a minute - where did all that xml come from? Was that always there? I thought that your peekmessage() method was stripping all those. Even if it is being stripped, there may be hidden characters e.g. '\n'.

So if the peekmessage isn't removing the tags, you could just use SimpleXML to get the data into an array or go overboard with a pregmatch.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.