Using require to Load Files in PHP : require « Utility Function « PHP
- PHP
- Utility Function
- require
Using require to Load Files in PHP
//File: library.inc
<?
function is_leapyear($year = 2004) {
$is_leap = (!($year % 4) && (($year % 100) || !($year % 400)));
return $is_leap;
}
?>
<?php
require ('library.inc'); // Parentheses are optional
$leap = is_leapyear(2003);
?>
Related examples in the same category