Bird
0
0

In PHP, which symbol is used to combine two string variables into one?

easy📝 Conceptual Q1 of 15
PHP - Operators
In PHP, which symbol is used to combine two string variables into one?
AThe plus (+) operator
BThe dot (.) operator
CThe ampersand (&) operator
DThe comma (,) operator
Step-by-Step Solution
Solution:
  1. Step 1: Identify string concatenation operator

    PHP uses the dot (.) operator to join strings.
  2. Step 2: Verify other operators

    The plus (+) operator is for arithmetic, ampersand (&) is for references, and comma (,) separates function arguments.
  3. Final Answer:

    The dot (.) operator -> Option B
  4. Quick Check:

    Dot operator joins strings [OK]
Quick Trick: Dot (.) joins strings, plus (+) adds numbers [OK]
Common Mistakes:
  • Using + instead of . for concatenation
  • Confusing & with concatenation
  • Using comma to join strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes