By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

String Concatenation Bug

P: n/a
Can anyone think of a reason why this is happening?

$b[1] = xxx //<enormously long string with at least 100000 characters>
$c[1] = yyy //<shorter but still a long string>

$a[1] = $b[1].$c[1];

echo "$a[1]";

Output:

"yyyxxx"
IT'S BACKWARDS. I can put them in any order, even copy them to non
array string variables and it still will put $b[1] last no matter what.

I've searched for hours on this. Any help would be appreciated.

-Grant
Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

On 17-Aug-2003, el********@yahoo.com (ecow) wrote:
Can anyone think of a reason why this is happening?

$b[1] = xxx //<enormously long string with at least 100000 characters>
$c[1] = yyy //<shorter but still a long string>

$a[1] = $b[1].$c[1];

echo "$a[1]";

Output:

"yyyxxx"
IT'S BACKWARDS. I can put them in any order, even copy them to non
array string variables and it still will put $b[1] last no matter what.

I've searched for hours on this. Any help would be appreciated.


My guess is you have some invalid HTML in the strings. Putting text between
the </tr><tr> tags or a missing </table> can do some pretty weird stuff
depending on the browser. Try validating the HTML on the page and see what
you get or at least do a view source in the browser.
--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.