0

Why are we putting dots there ?

echo "name is " .$name. //Why are there dots before and after $name?

17th Sep 2021, 6:46 AM
Serious Sam
Serious Sam - avatar
1 Respuesta
+ 1
php uses dots to concatenate strings so: echo "name is " . $name; => echo "name is $name"; and the dot after $name is meaningless and will raise an error (it should be ; not .) Note: dots should only be used before variables\strings not after them
17th Sep 2021, 7:00 AM
Nima