php test empty array is getting considered as string code example Example: array empty check in php if (empty($array)) { // list is empty. }