LoginSignup
1
0

More than 1 year has passed since last update.

【PHP基礎①】数値の入力と文字列の入力の違い

Last updated at Posted at 2022-06-13

[問題]  (参照:http://www.cc.kyoto-su.ac.jp/~mmina/bp1/hundredKnocksBasic.html)
1789+1758を計算して結果を表示するプログラムを作成しなさい。

コード

1. 数値として数字を入力する場合
echo 1789+1758;

2.文字列として数字を入力する場合
echo '1789+1758';

結果

1. 3547
2. 1789+1758

☆数値として表示させたい、計算させたい時は、' 'を付けない。

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