String Concatenation Bug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ecow

    String Concatenation Bug

    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
  • Tom Thackrey

    #2
    Re: String Concatenation Bug


    On 17-Aug-2003, elasticcow@yaho o.com (ecow) wrote:
    [color=blue]
    > 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.[/color]

    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

    Comment

    Working...