Old 17-06-2008, 22:44   #1 (permalink)
robdesign
Registered User
 
Join Date: May 2008
Posts: 62
Send a message via AIM to robdesign Send a message via MSN to robdesign
PHP .= operator

Before I get harassed, yes, I DID use Google. Still no help.

Can somebody explain wtf the ".=" operator does in php? I did find:

x.=y is the same as x=x.y

so does that mean if x = "hello " and y = "world" then

x.=y

will make "hello world"?

just a little confused. i don't know if this is worthy of a topic but i was really on my last nerve. thanks
  Reply With Quote
Old 17-06-2008, 22:51   #2 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,602
It's a string append operator. If you know javascript, its the same as '+='

$x = "abc";
$y = "def";
$x .= $y

// $x now equals "abcdef"

Your example ("hello world") is correct.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8