I want to get all video qualitys from string. My string:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=350000
128/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=750000
500/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000
750/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1250000
1000/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1750000
1500/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2750000
2500/prog_index.m3u8?key=49bfee85b05d117a2906368428094e94
And my PHP code:
preg_match_all("/(.*?)\/prog_index.m3u8/mis", $serviceurlget, $C);
print_r($C);
Returns:
Array
(
[0] => Array
(
[0] => #EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=350000
128/prog_index.m3u8
[1] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=750000
500/prog_index.m3u8
[2] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000
750/prog_index.m3u8
[3] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1250000
1000/prog_index.m3u8
[4] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1750000
1500/prog_index.m3u8
[5] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2750000
2500/prog_index.m3u8
)
[1] => Array
(
[0] => #EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=350000
128
[1] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=750000
500
[2] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000
750
[3] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1250000
1000
[4] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1750000
1500
[5] => ?key=49bfee85b05d117a2906368428094e94
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2750000
2500
)
)
But I don't want this result. I want it to return 128 500 750 1000 1500 2500
. How can I do it? I tried explode()
function. But it didn't work. I think there is a mistake with my regex code.