Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11

    Default

    Quote Originally Posted by Blinger View Post
    Your code looks more complicated!

    So i have a few questions: what does the ".=" thing mean? I presume it means $string .= $string+"</p><hr />"; ?

    And also, what does the last line mean? That is the most confusing part!
    .=
    PHP Code:
    $variable 'hi';
    echo 
    $variable// returns hi
    $variable .= ", what's your name?";
    echo 
    $variable // returns hi, what's your name?
    // All in all, when reading this in your browser, the return would be: hihi, what's your name? 
    /////////////////////////////////////////////
    // However, if we use the code below:
    $variable 'hi'
    $variable .= ", what's your name?"
    echo 
    $variable // returns hi, what's your name?
    // The end result is as expected hi, what's your name? 
    As you can probably see, .= just adds to the existing variable.

    As for the last line "substr_replace" simply replaces the text in a certain part of the string. (http://uk3.php.net/substr_replace)

    Edit: Oh yeah, it means what you said in your post, pft what a pointless explanation.

  2. #12
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Jam-ez View Post
    .=
    PHP Code:
    $variable 'hi';
    echo 
    $variable// returns hi
    $variable .= ", what's your name?";
    echo 
    $variable // returns hi, what's your name?
    // All in all, when reading this in your browser, the return would be: hihi, what's your name? 
    /////////////////////////////////////////////
    // However, if we use the code below:
    $variable 'hi'
    $variable .= ", what's your name?"
    echo 
    $variable // returns hi, what's your name?
    // The end result is as expected hi, what's your name? 
    As you can probably see, .= just adds to the existing variable.

    As for the last line "substr_replace" simply replaces the text in a certain part of the string. (http://uk3.php.net/substr_replace)

    Edit: Oh yeah, it means what you said in your post, pft what a pointless explanation.
    Actually the end result will be an error due to missing ;'s

  3. #13

    Default

    Quote Originally Posted by Blob View Post
    Actually the end result will be an error due to missing ;'s
    Ah, you win.

  4. #14
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Jam-ez View Post
    Ah, you win.


    Good example, though.

  5. #15

    Default

    Quote Originally Posted by Blob View Post


    Good example, though.
    Thanks a bunch, I don't post much round here (especially considering how long I've been on here...) so I try to make my helpful posts helpful.

Page 2 of 2 FirstFirst 12

Posting Permissions

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