-4

I was solving a question and got to see this one. I really don't know what it is. Just needed a one word answer for the problem.

Shivam Goyal
  • 44
  • 1
  • 9
  • 1
    echo will only print variable and json encoded strings on the other hand var_dump prints any type of data whether be array, string, objects etc. another differnce is that var_dump also show the data type with length etc while echo cant – khan Farman Oct 26 '18 at 05:44
  • In one word the only thing I can think of is 'Structure'? – Nigel Ren Oct 26 '18 at 06:02

1 Answers1

2

What value will var_dump show that echo will not show?

You cannot echo an array if you do so it will just print data type not the data, you can use var_dump to print complete structure and data of an array.

$array = array(1,2,3);

echo $array; //<----only print the data type

var_dump($array) //<-----print the complete structure
suvojit_007
  • 1,690
  • 2
  • 17
  • 23