Hi guys, I have a question about the preg_match function. Basically I have a script which telnets into a device (using fsockopen) and returns a string from a command.
The string returned is:
Routermodemstat ?
Outcome: Got modem status OK:
Time: 28 Jun 2010 20:21:21
SIM status: READY
Signal strength: -73 dBm
Manufacturer: Option N.V.
Model: GTM380
IMEI: 397164297692736,PE2999S18W
IMSI: 234998374619283
ICCID: 89447210485780564938
Firmware: 2.9.1Hd (Date: Dec 17 2007, Time: 16:00:17)
W-WAN Attachment Status: Attached
W-WAN Registration: Registered, roaming
GSM Registration: Registered, roaming lac:07 ci:1415
Network: 0,0,"Some Network",0
Preferred system: WCDMA first
GSM Cell mode: EDGE
WCDMA Cell mode: Non WCDMA/not registered
Last Error Report: Requested service option not subscribed
OK
I have tried using preg_match to get the values for each line (after the 🙂 but I am not getting any joy.
$array = split("(\n)|(: )", $data2);
What I need is values after the : such as signal strength (-73dBm) and the most difficult variable, the contents of the "" after Network: in this case Some Network.
Your help is greatly appreciated.
Thanks
Stuart