- $array = [
- 'a' => 'abc',
- 'aa' => 'abc',
- 'aaa' => 'abc',
- 'b' => 'bbc',
- 'c' => 'cbc',
- 'd' => 123,
- 1 => '123',
- 2 => 123
- ];
- $arr = array_keys($array,'123',false);
- echo '<pre>';
- print_r($arr);
- result:
- Array
- (
- [0] => d
- [1] => 1
- [2] => 2
- )
- //该片段来自于http://www.codesnippet.cn/detail/1709201513711.html
来源: http://www.codesnippet.cn/detail/1709201513711.html