[eluser]Rick Jolly[/eluser]
[quote author="Xeoncross" date="1219368396"][quote author="donpepito" date="1219334838"]
try this:
Code:
if (!empty($value['name'])) {
[/quote]
Why do people even waste CPU time on the empty function?
Just switch to boolean:
Code:
if($value['name']) {
[/quote]
It's not the same thing. From the php manual:
Quote:empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set.
So this produces an undefined index error:
Code:
if (! $_POST['does_not_exist']) // undefined index error
While empty() checks isset() first, so no error is produced:
Code:
if (empty($_POST['does_not_exist'])) // no error