[TriLUG] new PHP question - what's up with join()?
dragonstrider at gmail.com
Tue Jan 25 10:40:22 EST 2005
join usually works with an array. I'd try $fullName = join (' ',
Please note that unlike perl, you have to explicitly create an array in PHP.
On Tue, 25 Jan 2005 10:35:48 -0500, Greg Brown <gregbrown at mindspring.com> wrote:
> PHP documentation shows there is a join() function that should, at
> least in appearance work a lot like Perl's join. So, I have two
> variables I want to join $firstName and $lastName. The following
> appears like it should work:
> $fullName=join(' ',$firstName,$lastName);
> echo "$fullName<br>";
> $fullName does not appear to be populated, or at least it will not
> print. The reason I want to join the variable is I have to have a full
> name in a database field such as:
> $query="insert into address (firstName,fullName)
> Is there a better way to do this other then using join?
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
Personal e-mail: jtate AT dragonstrider DOT com
More information about the TriLUG