Can’t Use Method Return Value in Write Context – PHP Error

I got following fatal error in php can’t use method return value in write context. When this fatal error comes i didn’t understand what’s wrong with my code, as everything looks fine in my code editor. So i started debugging what’s the root cause for this error.

How to Check if a Value Exists in an Array in PHP

How to check if a value exists in an array in PHP. PHP inbuilt method such as in_array() to check if a value exists in an array. Apart from that we can also use array_search() through which we can check if a value exists in an array or not.

In this tutorial, we are going to write our own custom method to check if a value exists in an array in PHP.

Subscribe Our Tutorials

Get Latest Updates on Facebook

How to Check If a Value Exists in an Array in PHP

How to Check If a Value Exists in an Array in PHP

Let’s check how to solve this problem using PHP inbuilt method as well as our own custom function.