Trying to fix an illegal offset warning in PHP.
Below is the code that the error is being reported from.
foreach ( $xml->{'nowplaying-info'} as $song ) :
foreach ( $song->property as $property ) :
foreach ( $property->attributes() as $b => $a ) :
switch ( $a ) :
case 'cue_title':
$name = 'title';
break;
case 'track_artist_name':
$name = 'artist';
break;
default:
$name = $a;
endswitch;
if ( $name ) :
$prop = strip_tags( $property->asXML() );
if ( $name === 'title' || $name === 'artist' ) :
$prop = ucwords( strtolower( $prop ) );
endif;
$property_output[$name] = $prop;
endif;
endforeach;
endforeach;
$property_output['time'] = strip_tags( $song['timestamp'][0] );
$song_data[] = $property_output;
endforeach;
It appears to not like this line :
$property_output[$name] = $prop;
Appreciate the help on this.