I have a system that should forward incomming SMS to email. (Currently the script just forwards the file as is… Not very elegant.)
This system deals with a text file with multiple lines. I read it with file() directly into an array. The top few lines have a format as below, and I want to pick some parts out and format them into the email. The message is at the bottom of this text file, and may be over several line including blank ones.
How do I merge just the last few parts (message lines) of the array not knowing the number of lines that it has in total? I think I know which line to start at…
From: 479064xxxx
From_TOA: 91 international, ISDN/telephone
From_SMSC: 479200xxxx
Sent: 22-02-09 13:34:05
Received: 22-02-09 12:34:29
Subject: GSM1
Modem: GSM1
IMSI: 2420266xxxxxxxx
IMEI: 8643940xxxxxxxx
Report: no
Alphabet: ISO
Length: 5
Actual message comes here!