php 函数之 )_each()list()implode()explode()in_array()

<?php
/*
implode() 把数组组合成字符串
explode() 把字符串分割成数组
in_array() 检测内容是否在数组中
each()把数组元素拆分成新的数组
list() 把数组元素赋值给变量

echo "<pre>";

$arr = array("PHP课程","DIVCSS课程","JQUERY","JAVASCRIPT");
$str = implode(",",$arr);
echo $str;
*/

echo "<pre>";
$file=array('/uploads/a1.jpg','/uploads/a2.jpg','/uploads/a3.jpg');
$files = implode(',', $file);
echo $files;
$arr2 = explode(',', $files);
print_r($arr2);


/*
$files = implode(',',$file);
echo $files."<br/>";
$arr2 = explode(',',$files);
print_r($arr2);


$arr3 = array(1,2,3,4,5);
var_dump(in_array('1',$arr3));
*/
/*
$arr4 = array("url"=>"bbs.houdunwang.com","webname"=>"后盾网论坛");
$arr4_1 = each($arr4);
print_r($arr4_1);
$arr4_1 = each($arr4);
print_r($arr4_1);
var_dump(each($arr4));
*/
/*
$arr5 = array("url"=>"bbs.houdunwang.com","webname"=>"后盾网视频教程","class1"=>"PHP","class2"=>"DIVCSS");
while(list($k,$v) = each($arr5)){
echo $k."=>".$v;
echo "<br/>";
}
*/

  

你可能感兴趣的:(php 函数之 )_each()list()implode()explode()in_array())