5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

var_dumpとechoの違い

Last updated at Posted at 2016-11-02

・var_dump

詳細な情報が出る

入力
$txts = ['タロー', 'ジロー'];
var_dump($txts);
表示
array(2) { [0]=> string(9) "タロー" [1]=> string(9) "ジロー" }

・echo

ざっくり出る

入力
$txts = ['タロー', 'ジロー'];
echo $txts;
表示
Array

echoの方が入力は簡単だが、debugする際はvar_dumpが適切

5
7
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?