这里是如下数组:
$array = ['blog.setting', 'blog.post', 'blog.delete', 'blog.edit', 'other.other'];
我想知道是否存在具有'blog.'的元素;也许这样会很完美。
'blog.'
in_array('blog.*', $array)
有人可以帮我吗?
您需要使用正则表达式和array_filter方法
array_filter