PHPでのファイル挿入
1つのファイルがあるとします:
<?php
echo 'index';
?>
2つ目のファイルもあるとします:
<?php
echo 'test';
?>
2つ目のファイルの内容を1つ目のファイルに挿入してみましょう。これはinclude演算子を使って行います:
<?php
include 'test.php';
echo 'index';
?>
同じファイルは何度でも挿入できます:
<?php
include 'test.php';
include 'test.php';
include 'test.php';
echo 'index';
?>
ファイルfile1.php、file2.php、
file3.phpを作成してください。これらをメインファイルに接続します。