Today, We want to share with you php check if value exists in multidimensional array.In this post we will show you php check if value exists in array, hear for how to Check if value exists in multi-dimensional array or not. we will give you demo and example for implement.In this post, we will learn about PHP Check If Multiple Array Contains All Array with an example.
Php Check if value exists in multidimensional array or not.
Example PHP Array :
Example 1:
Array ( 'movie_id' => '198', 'u_name' => 'Tamilrockers', 'u_amount' => '789' ), '1' => Array ( 'movie_id' => '236', 'u_name' => 'bolly4u', 'u_amount' => '857' ), '2' => Array ( 'movie_id' => '538', 'u_name' => 'Khatrimaja', 'u_amount' => '478' ) ); ?>
check value present in above multi-dimensional array.
if(array_search(198, array_column($moviesdb, 'movie_id')) !== False) { echo "Good Luck, Value Present in Array"; } else { echo "Sorry, Data Value Not Found"; }
I hope you get an idea about php in multidimensional array.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.