The data queried by php is returned as a string public function flowcode (){
$ SQL _user = "select user from zong_code ";
$ Zong_code = M ("zong_code ");
$ Re = $ zong_code-> query ($ SQL _user );
// Var_dump ($ re );
$ Cc = $ this-> arr_foreach ($ re );
$ This-> display ();
}
Public function arr_foreach ($ arr ){
If (! Is_array ($ arr )){
Return false;
}
Foreach ($ arr as $ key => $ val ){
If (is_array ($ val )){
$ This-> arr_foreach ($ val );
}
Else {
Var_dump ($ str1 );
$ Str1 ="". $ Val ."". $ Str1;
}
}
// Echo "dfffffffffff ";
Return $ str1;
}
In this function, how does one query the data in the database? it is a multi-dimensional data group. how does one return the data to $ str1? the return and echo characters can be used, but the return statements cannot be used.
Reply to discussion (solution)
A resource connection is queried and needs to be read by another statement.
For mysql, see mysql_fetch_assoc.
No recursive return value is received during recursive calls.
If (is_array ($ val )){
??? $ This-> arr_foreach ($ val );
}
Agree to the moderator