2
Array
(
[0] =>
[1] => Array
(
[0] => #EXTM3U
)
[2] => Array
(
[0] => #EXTINF:-1 tvg-id="" tvg-name="BBB 18 -Aquecimento" tvg-logo"https://s9.postimg.org/4c14egx5b/big_welcome_Pic_4-300x169.png" group-title="Canais Globo",BBB 18 -Aquecimento (...)
)
[3] => Array
(
[0] => http://infinity.quor8.com:8000/live/N708Kwo02j/qsTfBzzoPk/12664.ts
)
[4] => Array
(
[0] => #EXTINF:-1 tvg-id="" tvg-name="Globo RJ FHD" tvg-logo="http://i.imgur.com/NSHvLCe.png" group-title="Canais Globo",Globo RJ FHD
)
)
I have this array above and need to take only the value of tvg-logo
I tried that way here: $array[2][tvg-logo];
But that was the result:
#EXTINF:-1 tvg-id="" tvg-name="BBB 18 -Aquecimento" tvg-logo="https://s9.postimg.org/4c14egx5b/big_Welcome_Pic_4-300x169.png" group-title="Canais Globo",BBB 18 -Aquecimento
as I said I need only the value of tvg-logo
Anyone can help ?
Hello Bsants, thanks for the help, I have not much experience with this, you could tell me how to do it in php, I tried to play what you said but I did not succeed
– André Luiz Mardonis
Hello, just put the code inside the php tag <?php ?>, if necessary, have a look at the documentation: http://php.net/manualen/function.parse-str.php. Otherwise, just manipulate the result of your $array. You can save the result to a new $suaString variable = $array[0][2] as in the example.
– BSants
Look how I did: $string = $array; echo "</pre>"; parse_str($string, $result); echo $result['tvg-id']; // "" echo $result['tvg-name']; /// "BBB 18 -Heating echo $result['tvg-logo']; // he returns: Warning: parse_str() expects Parameter 1 to be string, array Given in /home/u805601857/public_html/canais1.php on line 43
– André Luiz Mardonis
You can use a var_dump() http://php.net/manual/en/function.var-dump.php in the variable to see if it really is receiving what is expected, but it is error in the line 43. Test the same thing just with:
tvg-id="" tvg-name="BBB 18 -Aquecimento" tvg-logo="https://s9.postimg.org/4c14egx5b/big_Welcome_Pic_4-300x169.png"
– BSants
Look how I did it this time:
code
 $string_antiga = $array[2][0];

parse_str($string_antiga , $resultado);

echo $resultado['tvg-id'];
echo $resultado['tvg-name'];
echo $resultado['tvg-logo'];



But it returns no result.– André Luiz Mardonis
Would not be $array[0][2] ?? Another way would be to use the function explode() http://php.net/manual/en/function.explode.php marking after the signal from =.
$string_antiga = "tvg-id="" tvg-name="BBB 18 -Aquecimento" tvg-logo="https://s9.postimg.org/4c14egx5b/big_Welcome_Pic_4-300x169.png"; $string_nova = explode("=", $string_antiga); echo $string_nova[0]; echo $string_nova[1]; echo $string_nova[2];
– BSants
returned me the value:
code #EXTINF:-1 tvg-id"" tvg-name"BBB 18 -Aquecimento" tvg-logo
I need to return only the value of tvg-logo– André Luiz Mardonis
That’s what the $string_nova will receive already indexing the fields. Now you need to access the corresponding position you need. For example, give a echo in $string_nova[2]. Check the examples that are in the links of the documentation I sent you.
– BSants
doing so he retouche me this
code "https://s9.postimg.org/4c14egx5b/big_Welcome_Pic_4-300x169.png" group-title
see that you brought group-title to remove and leave only url ? so I only left echo $string_nova[3]; to receive this above.– André Luiz Mardonis
I get it. I can’t solve this problem. You could take advantage of this new problem and create another question that will definitely help you, or edit in your own post.
– BSants
Thanks Amigo!
– André Luiz Mardonis