php 数组的防止重复,key value的用法,拼接,拆分的用法

巴扎黑
Release: 2016-11-21 14:52:53
Original
1457 people have browsed it

 foreach($a as $key=>$val){//key 为数组$a 下标   $val为$a的值
            $val = array_unique($val);//这个是防止数组$val重复的
            $insertDate = array(//设置新的数组
                'ini_id' => $key,//数组下标'ini_id'
                'door_id'=>implode(',',$val)//拼接$a数组的值  explode是拆分
            );

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 [email protected]
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!