Multiple choice technology web 2.0

How do you print an array variable?

  1. echo

  2. print_r

  3. display

  4. all the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The print_r function formats and outputs human-readable information about a variable, including complex structures like arrays. Using echo directly on an array produces an Array-to-string conversion notice and prints only the word 'Array'.