郑秀文    "/>  郑秀文    ">

关于数组处理的有关问题,

WBOY
Release: 2016-06-13 12:00:14
Original
810 people have browsed it

关于数组处理的问题,急
$a=array("郑秀文","郭涛","华仔","高圆圆","王子义","郎月婷","刘德华")
$b=array("华仔","刘德华")

用B数组过滤掉$b数组中的重复

输出的效果为:
Array
(
    [0] => 郑秀文
    [1] => 郭涛
    [2] => 高圆圆
    [3] => 王子义
    [4] => 郎月婷
)
------解决方案--------------------

$a = array("郑秀文","郭涛","华仔","高圆圆","王子义","郎月婷","刘德华");<br />$b = array("华仔","刘德华");<br />print_r(array_diff($a, $b));
Copy after login
Array
(
    [0] => 郑秀文
    [1] => 郭涛
    [3] => 高圆圆
    [4] => 王子义
    [5] => 郎月婷
)

Related labels:
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 admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template