php check if array is set and not empty with echo code example Example: array empty check in php if (empty($array)) { // list is empty. }