Ask an array question var_export to get the result of $ varmysql_fetch_array (mysql_query ($ SQL): array (& nbsp; 0 & gt; a,) array (& nbsp; 0 & gt; b,) array (& nbsp; 0 & gt; c,) if the in_array function is used to match a field $ c, the ec will ask an array question.
Var_export returns the result of $ var = mysql_fetch_array (mysql_query ($ SQL:
Array (
0 => 'A ',
)
Array (
0 => 'B ',
)
Array (
0 => 'C ',
)
If the in_array function is used to match a field $ c, if it fails, echo N.
How do I express this expression?
------ Solution --------------------
PHP code
$ Arr = array (0 => array (0 => 'question three ', 'detail' => 'question three ',), 1 => array (0 => 'question four ', 'detail' => 'question four ',), 2 => array (0 => 'question Five ', 'detail' => 'question Five',),); $ test = array (0 => 'question three ', 'detail' => 'question three ',); if (in_array ($ test, $ arr) {echo 'yes ';}
------ Solution --------------------
Foreach ($ var as $ key => $ val ){
Foreach ($ val as $ k =>$ v ){
If (in_array ('C', $ v )){
Echo "C ";
} Else {
Echo "N ";
}
}
}
I don't know what kind of array you are using. you can try it.