PHP Multidimensional Array Searching (Find key by specific value)?

Very simple: myfunction($products, $needle) { foreach($products as $key => $product) { if ( $product'slug' === $needle ) return $key; } return false; }.

That is PERFECT. Thank you for your time. Spot on.

– Ben Kouba Nov 12 at 3:31 @BenKouba Glad to help you. – Aurelio De Rosa Nov 12 at 3:35.

php.net/manual/en/function.array-search.php Just use the built in function.

Wrong. This function will also return an index if a key! = slug has the searched value.

– Aurelio De Rosa Nov 12 at 4:24.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions