[TriLUG] new PHP question - what's up with join()?

Robert Ryals rryals at tmio.com
Tue Jan 25 10:41:44 EST 2005


David Rasch wrote:

>join takes an array as the second parameter:
>
>$fullName = join(' ', array($firstname, $lastname));
>echo "$fullName<br>";
>
>note that perl will only pass to a function an array of scalars, while
>php can actually take a set of parameters including arrays, objects, and
>scalars.  
>
>David
>
>  
>
And yes, there is a better (simpler) way to do what you want -

$fullName = "$firstName $lastName";




More information about the TriLUG mailing list