Re: Function return
| From: | Nathan Nobbe | Date: | Fri, 02 Nov 2007 14:51:24 +0000 |
| Subject: | Re: Function return | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263975@lists.php.net to get a copy of this message | ||
On 11/2/07, Dan Shirah <mrsquash2@gmail.com> wrote:
>
> Okay, so instead I should probably use:
>
> if($due_date != "")
> $insert2.=", due_date='$due_date'";
>
> Instead of using empty()
>
using emtpy is fine; just store the results of trim in a temporary variable:
$trimmed = trim($due_date);
if(!empty($trimmed)) {
$insert2 .= ", due_date='$due_date'";
}
-nathan