汇集一点关于数据深入一些的几个函数,去重,弹出,加入,查找。。。。
<?php $str = "时装,休闲,职业装"; $strs = explode(",", $str); print_r($strs); $str = array(明日,编程词典,网址,‘www.mrbccd.com‘,服务电话,"0431-84972266"); echo "<br>"; echo implode(" ",$str); echo "<br>"; $str = array(明日,编程词典,网址,‘www.mrbccd.com‘,服务电话,"0431-84972266"); echo count($str); echo "<br>"; echo array_search(‘www.mrbccd.com‘, $str); echo "<br>"; echo "弹出的最后一个单元是:".array_pop($str); echo "<br>"; array_push($str, "服务电话"); print_r($str); echo "<br>"; print_r(array_unique($str)); ?>
时间: 2024-10-07 05:46:25