How can I write this code in one php operator?
$menu = theme('nice_menu', 1, 10, 'down');
print $menu['content'];
Something like this:
prin开发者_如何学Pythont theme('nice_menu', 1, 10, 'down')['content'];
Not on a production version of PHP. This has been added to the trunk for the next version (Currently called 5.3.99DEV, but it's unsure if it'll be 5.4 or 6.0 or what)... It's called Array Dereferencing. See the RFP...
This is, unfortunately, not possible (at the current state of PHP). Your first example is the way to do it.
精彩评论