Re: SMF PHP error... Am I missing something subtle in the PHP language syntax?
- From: "Álvaro G. Vicario" <webmasterNOSPAMTHANKS@xxxxxxxxxxxxxx>
- Date: Mon, 29 Sep 2008 21:42:49 +0200
*** William Krick escribió/wrote (Mon, 29 Sep 2008 11:49:14 -0700 (PDT)):
// generates errors
$tboard = $context['linktree'][2]['name'];
$tboard = empty($tboard)?'':' - '.$tboard;
// no errors
$tboard = empty($context['linktree'][2]['name'])?'':' - '.
$context['linktree'][2]['name'];
The key point is that empty($foo) does not trigger a notice when $foo is
not set.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
.
- References:
- SMF PHP error... Am I missing something subtle in the PHP language syntax?
- From: William Krick
- SMF PHP error... Am I missing something subtle in the PHP language syntax?
- Prev by Date: Re: accents being replaced with garbage in text fields on forms
- Next by Date: Re: Manually setting session ids
- Previous by thread: SMF PHP error... Am I missing something subtle in the PHP language syntax?
- Index(es):
Relevant Pages
|