Array_keys () B function? Docs. php. netmanualhfunction. array-keys.php & lt ;? & Nbsp; $ xarray (1 & gt; aa, 2 & gt; bb, 3 & gt; cc, 4 & gt; bb); & nbsp; & nbsp; $ y1ar array_keys () B function?
Http://docs.php.net/manual/zh/function.array-keys.php
$ X = array ("1" => "aa", "2" => "bb", "3" => "cc ", "4" => "bb ");
$ Y1 = array_keys ($ x, bb, false );
$ Y2 = array_keys ($ x, bb, true );
Print_r ($ x );
Print_r ($ y1 );
Print_r ($ y2 );
?>
What is the role of the 3rd function parameters?
Why did the program go wrong?
Share to: "aa", "2" => "bb",... 'data-pics = '/img/2013/10/14/10013477 .png'>
------ Solution --------------------
Strict
Determine whether to use strict comparison (=) during search ).
The error is caused by $ y1 = array_keys ($ x, bb, false). bb is not enclosed in quotation marks. php first considers it a constant, and your code does not have a constant, so an error is reported.