0

I have this code:

echo "<p>" + $username + "<\/p>"

and $username is a string. I get this error:
Warning: A non-numeric value encountered
I don't know why i get this. How can i fix this?

Nobert
  • 153
  • 14
  • 1
    PHP uses a "." for string concatenation, not a "+" as many other languages. https://www.php.net/manual/en/language.operators.string.php – arkascha Sep 30 '20 at 18:17

1 Answers1

1

Use "." instead of "+" to concat strings, "+" is only for Arithmetics.

andrbrue
  • 691
  • 6
  • 14