相關關鍵詞
關于我們
最新文章
php array_values 返回數(shù)組的值實例詳解
array_values 返回數(shù)組中所有的值
基本語法:
array array_values ( array $input )
array_values() 返回 input 數(shù)組中所有的值并給其建立數(shù)字索引。
參數(shù)介紹:
參數(shù) | 描述 |
---|---|
input | 必需。規(guī)定數(shù)組。 |
返回值:
返回含所有值的索引數(shù)組。
注意:
返回的新數(shù)組的所有將使用數(shù)字索引,從0開始。
實例:
<?php $array = array( "php" => "php code", "html" => "html code", "css" => "css code", "js" => "js code", ); print_r(array_values($array)); ?>