Failide lisamine PHP-s
Oletame, et meil on üks fail:
index.php<?php
echo 'index';
?>
Oletame, et on ka teine fail:
test.php<?php
echo 'test';
?>
Paneme teise faili sisu esimesse faili.
See tehakse operaatori include abil:
index.php<?php
include 'test.php';
echo 'index';
?>
Sama faili saab lisada mitu korda:
index.php<?php
include 'test.php';
include 'test.php';
include 'test.php';
echo 'index';
?>
Задание 1
Tehke failid file1.php, file2.php,
file3.php. Ühendage need oma põhifailiga.