Hi all,
I'm very new to the concept of classes and OO, but I thought I'd try my hand at writing a class and I have a question.
I'm trying to access an array which a function within a class returns, but I can't seem to do it in one line of code; instead I have to write two.
For example,
$myplayer = new slimp3();
$temp = $myplayer->nowplaing();
echo "Current track being played: " . $temp['title'];
I'd like to combine the last two lines into one.... is this possible? I've tried stupid things such as:
$myplayer->nowplaying()['title']
but without joy (not surprisingly).
Any help much appreciated!
Ian