php - Search inside Array for Value on a MYSQL Output -
Text after "itemprop =" text ">
The code below works or does not seem to find anything on an array. I am using "In_Rere" to find a needle in the stack. I also tried to explode the contents separately from a comma and would not work. Any suggestions? In addition, I tried "array_search"
$ Q4 = "domain_name, slots_config.bid slots_pid, slots_config, slots_sites, select from where slots_config.bid = slots_pid.bid & amp; .amp3; slots_sites.aid = slots_pid .aid "; $ Result4 = mysql_query ($ q4); While ($ line = mysql_fetch_array ($ result4)) {$ resultarray [] = $ line; } If (in_array ("test", $ resultarray)) {echo "found matching"; } Else {echo "Milan did not match"; }
in_array () array will not work with it , Because it is multi-functional.
Your array looks like this:
$ resultarray [0] ['domain_name'] = 'first line domain name'; $ As a result [0] ['bid'] = 'first line bid'; $ As a result [1] ['domain_name'] = 'second line domain name'; ... You can not use in_array () to use it, so you have to do it in another method, some looping array Or building $ resultarray differently.
Similarly, array_search () does not work on multi-directional arrays, so that you can do something like looping
Comments
Post a Comment