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

Greg Brown gregbrown at mindspring.com
Tue Jan 25 10:35:48 EST 2005


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) 
values('$firstName','$fullName')";

Is there a better way to do this other then using join?

Greg




More information about the TriLUG mailing list