include & require
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
include dhe require e fusin një skedar tjetër PHP në vendin ku i shkruan — p.sh. header.php në krye të çdo faqeje. Dallimi: nëse skedari mungon, require e ndal programin, include vetëm paralajmëron. _once siguron që të futet vetëm një herë.
EnglishEN
include and require insert another PHP file where you write them — e.g. header.php at the top of every page. The difference: if the file is missing, require stops the program, include only warns. _once makes sure it's included only once.
Si ta mendosh
Si ta ngjitësh të njëjtin kokë letre në krye të çdo letre.
Lexoje në anglisht
Like using the same letterhead at the top of every letter.
Shembull kodiphp
<?php
require_once __DIR__ . "/config.php";
include "header.php";
echo "<main>Përmbajtja</main>";
include "footer.php";