Re: fullname
| From: | CC Zona | Date: | Wed, 31 Jul 2002 03:12:16 +0000 |
| Subject: | Re: fullname | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110447@lists.php.net to get a copy of this message | ||
In article <001301c23799$2deb3b30$100a0a0a@skink>,
dfreeman@outbackqld.net.au (David Freeman) wrote:
> > is there some other easyer way to do in one line than this?:
> >
> > $fullname = $session["f_name"];
> > $fullname .= " ";
> > $fullname .= $session["l_name"];
>
> $fullname = $session["f_name"] . " " . $session["l_name"];
...or *if* f_name and l_name are guaranteed to be the only elements of
array $session *and* they're in the needed order, you could do:
$fullname=implode(" ", $session);
But that requires the proper foreknowledge. Simple concatenation, like
above, is the safer bet.
--
CC