i need to fetch data from the following strings and need to place their values according to their type
1)
Response: Success Message: Mailbox Message Count Mailbox: 6000 UrgMessages: 0 NewMessages: 5 OldMessages: 12
Required Output: example OLD= 12 NEW=5 URGENT=0
2)
Name : 6000
Secret :
MD5Secret :
Context : DLPN_Admin
Language :
AMA flags : Unknown
Transfer mode: open
MaxCallBR : 384 kbps
CallingPres : Presentation Allowed, Not Screened
Call limit : 2147483647
Callgroup : 1
Pickupgroup : 1
Callerid : “Arham Ali” <6000>
ACL : No
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Sess-Min-SE : 90 secs
Codec Order : (ulaw:20,gsm:20)
Auto-Framing: No
Required Output: CallerId=”Arham Ali” Name= “6000”
I am very much stuck with this stupid thing for so long please help me in PHP domain.
If you need a bit more incase the message string is not always the same you could do this
This is all using regex. preg_match
The same methods would apply for the second half of your question.
A good tool to play with regex is http://gskinner.com/RegExr/
Hoep this helps you out!