New features of PHP5.4: Array dereferencing support_PHP tutorial

WBOY
Release: 2016-07-13 17:48:29
Original
848 people have browsed it

A long-awaited feature is finally here, here we go~

Array dereferencing is a good thing. With Array dereferencing, the previous way of writing is no longer necessary:

List($name,) = explode(",", "Laruence, male");
?>
Instead:

$name = explode(",", "b, x")[0];
In addition, Array derefencing can also appear in the lvalue of a reassignment statement, which means that theoretically you can write like this:

explode(",", "test1, test2")[3] = "phper";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478426.htmlTechArticleA long-awaited feature is finally available. In a twist~ Array dereferencing is a good thing, with Array dereferencing , the previous writing method is no longer necessary: ​​?php list($name,) =...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template