array_keys:返回数组中符合条件的键,组成为一个新的数组
程序员文章站
2022-05-02 16:13:20
...
$array = [ 'a' => 'abc', 'aa' => 'abc', 'aaa' => 'abc', 'b' => 'bbc', 'c' => 'cbc', 'd' => 123, 1 => '123', 2 => 123 ]; $arr = array_keys($array,'123',false); echo ''; print_r($arr); result: Array ( [0] => d [1] => 1 [2] => 2 )