Home  >  Article  >  Backend Development  >  数组中过滤的有关问题

数组中过滤的有关问题

WBOY
WBOYOriginal
2016-06-13 13:34:58813browse

数组中过滤的问题

array('中国','人民',大中国');

因为‘中国’存在于‘大中国’中,我想让它去掉只留下
array('人民',大中国'); 

如何做,有没有什么函数?

------解决方案--------------------
用array_shift()函数

PHP code
$arr = array("hello","world","yes");
array_shift($arr);
print_r($arr);

------解决方案--------------------
substr(0,6,array('中国','人民',大中国');
就可以了
Statement:
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