1
2

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

PHPとは動的にWebページを生成することができるサーバーサイドのスクリプト言語です。他の言語と比べて文法もわかりやすく初心者には勉強しやすい言語になっています。

また、MySQLなどのデータベースとの連携が容易なことなどから、WordPressを含めたWebアプリケーションの開発にもよく使われる有名なスクリプト言語です。

言語バージョン##

こちらの記事では

  • PHP version 7.3.11
  • ブラウザ Google Chrome

基本的な書き方##

PHPを使用した書き方は以下のようになります

index.php
<?php

//処理したい内容

?>
の間に処理の内容を書いていきます。

?とphpの間に半角スペースを入れるとエラーになるので注意です

「?>」の省略について###

?>のあとにHTMLやJavaScriptなどの他の言語のコードがない時は「?>」を省力することができます

index.php
<?php

//処理したい内容

HTML内に記述###

PHPはHTML内に記述することができます。

index.php

<h1><?php echo 'Hello World!'; ?></h1>

下記と同じ内容になります。

index.html

<h1>Hello World!</h1>

今回は以上です

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?