PHP:
I have made up a function that returns an array. I would like to be able to echo only one part of this array without having to make a variable like this:
$var = meth_0('getPlayerLimit');
echo $var['success'];
Is this possible? I´ve already tested doing what’s bellow and it didn´t work.
echo meth_0('getPlayerLimit')['success'];
Thanks for your time 🙂
You can do it with
PHP 5.4, it is called array dereferencing:example taken at http://www.waynemay.com/function-array-dereferencing-in-php-5-4-03052012