"file":"[480p]\/storage\/458f706a\/hls\/stream_2.m3u8,[720p]\/storage\/458f706a\/hls\/stream_1.m3u8,[1080p]\/storage\/458f706a\/hls\/stream_0.m3u8","thumbnails":"\/storage\/458f706a\/thumbnails\/data.vtt",
[480p]\/storage\/458f706a\/hls\/stream_2.m3u8,
отдельно в preg_match_all $string = '[480p]\/storage\/458f706a\/hls\/stream_2.m3u8,[720p]\/storage\/458f706a\/hls\/stream_1.m3u8,[1080p]\/storage\/458f706a\/hls\/stream_0.m3u8';
preg_match_all('/([^,]+)/', $string, $matches);
print_r($matches[0]);
Array
(
[0] => [480p]\/storage\/458f706a\/hls\/stream_2.m3u8
[1] => [720p]\/storage\/458f706a\/hls\/stream_1.m3u8
[2] => [1080p]\/storage\/458f706a\/hls\/stream_0.m3u8
)
$a = "[480p]\/storage\/458f706a\/hls\/stream_2.m3u8,[720p]\/storage\/458f706a\/hls\/stream_1.m3u8,[1080p]\/storage\/458f706a\/hls\/stream_0.m3u8";
preg_match_all('/(\[480p\].*?),/', $a, $m);
var_dump($m[1][0]);
$a = "[480p]\/storage\/458f706a\/hls\/stream_2.m3u8,[720p]\/storage\/458f706a\/hls\/stream_1.m3u8,[1080p]\/storage\/458f706a\/hls\/stream_0.m3u8";
$a = explode('[480p]', $a);
if (isset($a[1])) {
$a = explode(',', $a[1]);
var_dump('[480p]' . $a[0]);
}