Bird
0
0

Which escape sequence is used to insert a tab space inside a double-quoted string in PHP?

easy📝 Conceptual Q1 of 15
PHP - Output and String Handling
Which escape sequence is used to insert a tab space inside a double-quoted string in PHP?
A\\
B\n
C\r
D\t
Step-by-Step Solution
Solution:
  1. Step 1: Understand common escape sequences in PHP strings

    Escape sequences like \n represent new line, \t represents tab, \r carriage return, and \\ a backslash.
  2. Step 2: Identify the escape sequence for tab

    The tab character is represented by \t inside double-quoted strings.
  3. Final Answer:

    \t -> Option D
  4. Quick Check:

    Tab escape sequence = \t [OK]
Quick Trick: Tab in strings is always \t inside double quotes [OK]
Common Mistakes:
  • Confusing \n (new line) with \t (tab)
  • Using single quotes where escapes don't work
  • Using \r for tab

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes