php - Using in_array for multidimensional arrays -


OK, so I have this array: -

  0 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0707105396' (length = 10) 0 = & gt; String '0707105396' (length = 10) 1 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0704671668' (length = 10) 0 = & gt; String '0704671668' (length = 10) 2 = & gt; Array (size = 2) 'receiver_telom' = & gt; String '0707333311' (length = 10) 0 = & gt; The string '0707333311' (length = 10)  

and I am trying to use the in_array in this code. But, I never get any real value here what I am trying to do: -

  $ searchnumber = '0707333311'; If (in_array ($ searchnumber, $ arrayAbove)) {// do something}  

But if there is always a result of a false output, I think I'm not using the in_array correctly I am What should I do to get this job done? Thank you.

  $ array = array ("0" = & gt; array ("receiver_telmob" =) & Gt; "0707105396", "0" => "0707105396"), "1" => array ("receiver_telom =" => "0704671668", "0" => "0704671668") , "2" = & gt; array ("receiver_telom =" gt; "0707333311", "0" => "0707333311")); $ Searchnumber = "0707333311"; Forex currency ($ array as $ v) {if ($ v ['receiver_telmob'] == $ searchnumber) {$ found = true; }} Echo (isset ($ milli)? 'Search success': 'Search failed');  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -