SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am trying to do something like

    $html .= $thing

    sort of thing but actually want $thing to go at the front of $html. It there a quick way to do this? I guess

    $html = $thing . $html will work but any quicker?

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's as simple as it gets -- that's what the concatenation operator is for really.

    Edit: Do you need the value in $html? Otherwise you could just flip it around:

    $thing .= $html;
    Last edited by TWTCommish; May 16, 2001 at 13:47.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i need $html, i am building up $html from an array but the array is running in the opposite order from the way i want the html displayed if you see what i mean. my 2nd line works fine just wondering...

    cheers.

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm -- perhaps you could could simply output the array in reverse? I think PHP has a function for this: http://www.php.net/manual/en/function.array-reverse.php

  5. #5
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh.. cool, thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •