B
B
BlackReader2022-03-17 09:21:00
PHP
BlackReader, 2022-03-17 09:21:00

How to take one element from the response from the browser?

Here is the code
$info2 = file_get_contents(' https://191.138.1.191:8080/s/hls_api/get_video?cha... ');
$info2 = json_decode($info2, true);
echo "";
var_dump($info2);
echo "";
?>
take the response it gives
array(3) {
["token"]=>
string(8) "IMcsdfsSFa"
["hls"]=>
string(51) " https://191.138.1.191:8080/hls /IMcsdfsSFa/master.m3u8 "
["sid"]=>
string(8) "sClNdLDKfsJ"
}
And put this value into the variable without quotes https://192.168.1.192:8080/hls/IMcsdfsSFa/master.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2022-03-17
@BlackReader

$variable = $info2['hls'];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question