0
0

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 3 years have passed since last update.

PHP出力方法

Last updated at Posted at 2021-11-09

PHP

hello.php
<?php echo "おはよう"?>
<?php echo "こんにちは"?>
<?php echo "こんばんは"?>

ターミナルに以下を入力しましょう!

~$ php hello.php

このように出力されました!

結果
おはよう こんにちは こんばんは

配列

index.php
<?php $k = Array(4,1,6);

    echo ("おにぎりを".$k[0])."個下さい"."\n";
    echo ("コーヒーを".$k[1])."杯下さい"."\n";
    echo ("ケーキを".$k[2])."個食べたい"."\n";

「\n」は改行の意味です!
ターミナルに以下を入力しましょう!

~$ php index.php

このように出力されました!

結果
おにぎりを4個下さい
コーヒーを1杯下さい
ケーキを6個食べたい
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?