LoginSignup
0
0

More than 5 years have passed since last update.

phpで変数はダブルクオーテーションの中に入れられるよ、という話

Last updated at Posted at 2018-03-18

すっごい初歩的な話ですけど。

わざわざbrタグを2行にして書く必要ないですよ、というのと
ダブルクオーテーションの中だったら変数もちゃんと変換してくれるよ、という話。

echo $row->from_user_id
echo "<br>";

こう書き換えられます。

echo "$row->from_user_id<br>";

スッキリ☆

さらに言うと、変数は{}で囲んだほうがいいらしい!

echo "{$row->from_user_id}<br>";
0
0
0

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
0
0