LoginSignup
1
0

More than 1 year has passed since last update.

【PHP基礎復習15】文字列の連結

Posted at

[問題]
次の入力された2つの数字を「/」で区切って出力させなさい。

コード

$input1 = fgets(STDIN);
$input2 = fgets(STDIN);
echo trim($input1). "/" .$input2;

↓ 11、12と入力

結果

11/12

☆trim()
→ 文字列の先頭、末尾にある空白スペースを取り除く

☆'文字列A'.'文字列B'
→ 「.」で文字列を連結させることができる

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