Jump to content

using DOT before variable


Alfraganus
 Share

Recommended Posts

In PHP, the dot is the concatenation operator. See this link: http://www.w3schools.com/php/php_operators.asp ...scroll down to String Operators.

 

If you don't want to use the dot operator to concatenate, you can use double quotes with the variable included like the following: echo "My eye color is $color"; Because of being in double quotes, PHP displays(parses) the value of the variable $color. The output is: My eye color is green.

Edited by Don E
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...