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?

PHP学習メモ①

Last updated at Posted at 2025-02-10

環境の設定、事前準備

使用環境:Xampp、VSCode

PHPファイル名を「selfphp」(任意)とする

①PHPファイルの保管場所(★ローカル)
└ C¥xampp¥htdocs¥selefphp

スクリーンショット 2025-02-07 213423.png

Xamppは「Apache」、「MySQL」を「Start」する

スクリーンショット 2025-02-07 213423.png

練習コード

VSCodeでまず「ht」と入力、選択しから「html:5」を押すと
PHPを始めるのに必要なコードが一気に入力される

html:5の動作
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PHPの基本</title>
</head>
<body>
<?='こんにちは、世界!' ?><br />
<?='こんにちは、皆さん!' ?>
</body>
</html>

chap01という階層の直下に「hello.php」として保存

xamppのサーバーでの表示画面
http://localhost/selfphp/chap01/hello.php

スクリーンショット 2025-02-07 213423.png

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?