开发者

Get a value of returned array

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜