1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP -What does this mean......

Discussion in 'General PHP and MySQL Discussions' started by DaveL, Oct 11, 2011.

  1. DaveL

    DaveL Well-Known Member

    Im going through a few tutorials and was wondering if anyone would be able to tell me what ." means?

    Ive tried google but not having much joy!

    This is the context in which it is used -
    $contents .= 

    Plus if anyone knows ofa webpage that lists all of these kind of expressions with their meaning it would be really appreciated. I seem to know the basic ones, but theres a few popping up im not to sure on.
  2. ragtek

    ragtek Guest

    $var .= 'add me';

    is the same as

    $var = $var . 'add me';

    you can do the same with + , -

    hope this helps, (sorry, i don't know how this is called in english;) )
    Fuhrmann and DaveL like this.
  3. James

    James Well-Known Member

    DaveL likes this.
  4. DaveL

    DaveL Well-Known Member

    Thank you both, got it now :D
  5. SheepCow

    SheepCow Well-Known Member

  6. Jaxel

    Jaxel Well-Known Member

    Yeah... I always thought it was odd that PHP has a .= operator, but not a =.
    Daniel Thomann and James like this.
  7. Daniel Thomann

    Daniel Thomann Active Member

    I think that is because the array association '=>'.. if you make it greater or same you have to make '>=' and eventually it cames from there.
  8. SheepCow

    SheepCow Well-Known Member

    I believe it's because in C if it was assignment (=) addition (+), it would have to be the same for other assignment-operation operators, and things like:

    a =- 2;

    The compiler wouldn't know if you mean "a equals minus 2" or "a subtract 2, assign to a" as whitespace has little meaning.

Share This Page