Home >php教程 >php手册 >php的list()的一步操作给一组变量进行赋值的使用

php的list()的一步操作给一组变量进行赋值的使用

WBOY
WBOYOriginal
2016-06-06 20:37:07919browse

我们在切割字符串可能会把切出来的数组一个一个付给每个变量,很麻烦的,我们可以用list()函数来完成

例如:
list($a,$b) = explode(" ",microtime());
echo $a.'------'.$b;
?>
结果:0.60937700-----1305625768

Statement:
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