-1

PHP を使用して複数のページで同じ html シェルを使用したいので、複数ではなく 1 つのページを変更するだけで済みます。

どうやら、必要な行は 1 行だけです。

4

2 に答える 2

1

多くのphpファイルで何度も使用されるコードを別のphpファイルに移動するだけで、3つの方法で使用できます

<?php include 'filename.php';?>//suppose not found then include will only produce a warning (E_WARNING) and the script will continue

<?php require 'filename.php';?>//suppose not found require will produce a fatal error (E_COMPILE_ERROR) and stop the script

<?php require_once 'filename.php'; ?>//include only once in whole same PHP file

私はそれがあなたを明確にすることを願っています.....

于 2012-09-02T03:54:19.053 に答える
0

新しいファイルを作成し、そこにすべての html を配置してから、そのファイルの内容を表示するすべてのページにこのコードを追加できます。

<?php require_once 'filename.php'; ?>
于 2012-09-02T03:02:49.103 に答える