Maison  >  Article  >  développement back-end  >  php函数var_dump,var_export,print_r的用法区别

php函数var_dump,var_export,print_r的用法区别

WBOY
WBOYoriginal
2016-07-25 08:58:26914parcourir
  1. Warning: fopen(slsl.txt) [function.fopen]: failed to open stream: No such file or directory in E:\mywww\yangtest\base1.php on line 6

  2. array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(32) [3]=> int(322) [4]=> int(3433) [5]=> array(3) { [0]=> int(32) [1]=> int(232) [2]=> int(23232) } }
  3. int(1234)
  4. string(11) "alsdfl;asdf"
  5. string(1) "a"
  6. bool(false)
  7. array ( 0 => 1, 1 => 1, 2 => 32, 3 => 322, 4 => 3433, 5 => array ( 0 => 32, 1 => 232, 2 => 23232, ), )

  8. 1234
  9. 'alsdfl;asdf'
  10. 'a'
  11. false
  12. Array ( [0] => 1 [1] => 1 [2] => 32 [3] => 322 [4] => 3433 [5] => Array ( [0] => 32 [1] => 232 [2] => 23232 ) )
  13. 1234
  14. alsdfl;asdf
  15. a
复制代码

注意以上的输出,相信大家可以理解函数var_dump,var_export,print_r的区别了。 注意,最后一个不是贴出来,而是它本来就没有显示什么。 希望对大家有所帮助。



Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn