Welcome Guest, Not a member yet? Register   Sign In
Latavish's Multiple Image Upload with Thumbnail Generation
#9

[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


Messages In This Thread
Latavish's Multiple Image Upload with Thumbnail Generation - by El Forum - 08-21-2008, 02:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB