PHP Warning: Attempt to read property "SONGTITLE" on bool in

106 views Asked by At

PHP Warning: Attempt to read property "SONGTITLE" on bool in

PHP Deprecated: addslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /home2/radiosound/public_html/80s/assets/php/config.php on line 31

`function Streaming(){ global $radio;

$shoutcast = @simplexml_load_file("http://live.radiosoundfm.com.br:8398/stats?sid=1");

$music = htmlspecialchars(addslashes($shoutcast->SONGTITLE));
$singer = ''; $name = $music;
if(strpos($music, '-') !== false && substr_count($music, '-') == 1){
    $data = explode('-', $music);
    $singer = trim($data[0]) != '' ? trim($data[0]) : '';
    $name = trim($data[1]) != '' ? trim($data[1]) : '';
}

$data = array(
    'music' => $music,
    'name' => $name,
    'singer' => $singer
);

return $data;

}`

0

There are 0 answers