S
S
SteepNET2020-01-31 18:00:40
PHP
SteepNET, 2020-01-31 18:00:40

Remove unnecessary, convert to json?

Good afternoon!
It was necessary to take one parameter, I take

$data1 = shell_exec("asterisk -rx 'queue show'| grep wait:");

I get:
1. SIP/167630-000011f3 (wait: 3:00, prio: 0)
2. SIP/167630-000011f4 (wait: 1:31, prio: 0)
...
..
I need to take these time numbers after wait: 3:00 and wait: 1:31 , add
In the end, I would like this
{"4:31"}

I would appreciate your help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2020-01-31
@SteepNET

sscanf()to help

F
FanatPHP, 2020-01-31
@FanatPHP

Remove unnecessary, convert to json?
1 subscriber 9 minutes ago 10 views
Convert to JSON?
3 followers Jan 27 244 views
Convert to JSON?
1 follower Jan 21 104 views
Of course we understand that you are not a specialist and you have nowhere else to turn.
But with so many tasks, you should already think about hiring a specialist.
At least he will tell you that {"110":"2":"4:31"} is rubbish, and you need to come up with some other format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question