On Tue, Aug 12, 2003 at 01:58:21PM -0600, Micah Montoy wrote:
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.
A bunch of simplifications, efficiency tweaks on this approach...
$wresult = ;
$wresult = '';
Micah,
The sign in PHP (to the best of my knowledge) does not concatenate.
Use a . instead. See below.
$wresult = ;
foreach ($search_string as $word_result){
$wresult .= $word_result;
}
That should work for you.
Jonathan Pitcher
On Tuesday, August 12, 2003, at 02:58 PM, Micah
Analysis Solutions mailto:[EMAIL PROTECTED]
on Tuesday, August 12, 2003 1:02 PM said:
OR you can do...
$wresult .= $word_result;
Don't forget the space:
$wresult .= .$word_result;
c.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
From: Jonathan Pitcher [EMAIL PROTECTED]
The sign in PHP (to the best of my knowledge) does not concatenate.
Correct, it's a bitwise AND operator.
http://us2.php.net/manual/en/language.operators.bitwise.php
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
- Original Message -
From: Peter James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 2:18 PM
Subject: Re: [PHP] string concatenation from array
My personal favourite is to use an array. It's much cleaner syntax
IMO...it
is very easy to miss a '.' on a '.=', and introduce
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
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
, 2003 2:00 PM
Subject: RE: [PHP] string concatenation from array
Use the . concatenation operator. : )
$wresult = ;
foreach ($search_string as $word_result) {
$wresult = $wresult . . $word_result;
}
echo $wresult;
Matt
-Original Message-
From: Micah Montoy [mailto
8 matches
Mail list logo