How do I find if an array has one or more elements?
I need to execute a block of code where the size of the array is greater than zero.
if ($result &
If you want to only check if the array is not empty, you should use empty() - it is much faster than count(), and it is also more readable:
count()
if (!empty($result)) { // ... } else { // ... }