开发者

Can PHP be more like python? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Does PHP have an equivalent to Python's list com开发者_如何学编程prehension syntax?

Does PHP have any equivalent of the simple and awesome list comprehension in python? Specifically, can I do a = [x for x in xrange(1,20)] in PHP w/o annoying loops?


I think this will set you free: http://code.google.com/p/php-lc/


Correct me if I'm wrong, but isn't the python 'x for x in xrange' a loop?


$a = range(1,19);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜