Use the "." concatenation operator. : )
$wresult = ""; foreach ($search_string as $word_result) { $wresult = $wresult . " " . $word_result; } echo $wresult; Matt > -----Original Message----- > From: Micah Montoy [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 12, 2003 3:58 PM > To: [EMAIL PROTECTED] > Subject: [PHP] string concatenation from array > > I'm having a bit of difficulty getting a string to attach to itself from > an > array. Here is the bit of code I'm working on. > > $wresult = ""; > > foreach ($search_string as $word_result){ > $wresult = $wresult & " " & $word_result; > } > > echo ("$wresult"); > > Anyone see why when I run through each part of the array, it won't attach > the next string and so on? > > thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php