ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
【PHP检测数组有哪里连续的字符串,以及有多少个】 ~~~ <?php $ranges = array('22323', '123', '可以', 'cpu', 'cpu.', '22311', ' cpu', '8cpu', 'c0pu'); $has = array(); foreach ($ranges as $value) { if(strpos($value, 'cpu') !== false) { $has[] = $value; } } print_r($has); echo '<hr/>'.count($has).'<br/>'; ~~~