Here is my array ouput
Array
(
[1] => 1
[2] => 2
[3] =>
)
How do I know the [3] => is empty?
foreach ($array as $key => $value) {
if (empty($value))
echo "$key empty <br/>";
else
echo "$key not empty <br/>";
}
My out put showing all is not empty. What is correct way to check is empty?
It works as expected, third one is empty
http://codepad.org/yBIVBHj0
Maybe try to trim its value, just in case that third value would be just a space.
Or to make it a function