输出指定的值,除了索引方式还有其它方式吗?
public function index(){
$new = $this->index_com();
//输出指定的值
echo $new[2];
}
public function index_com(){
$list = 'a';
$category = 'b';
$totalCount = 'c';
$current = 'd';
return array($list, $category, $totalCount, $current);
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
还可以是字典,
使用list语法可以达到你想要的效果: