0

Why does PHP's var_dump() print fist when I make it the second element of a concatenated string?

echo  "log_files: " . var_dump($log_files);

=> array (size=4)
      0 => string '.' (length=1)
      1 => string '..' (length=2)
      2 => string 'non_ssl_log.txt' (length=35)
      3 => string 'ssl_access_log.txt' (length=31)
   log_files:

And how can I prevent this?

1252748
  • 14,597
  • 32
  • 109
  • 229

1 Answers1

0
echo "log file : \n";
var_dump($log_files);

as for reason why its doing it no clue sorry.

bountyh
  • 165
  • 9
  • also possible duplicate http://stackoverflow.com/questions/8364232/why-do-print-r-and-var-dump-execute-before-echo – bountyh Mar 11 '14 at 14:49