Using include to Load Files in PHP : include « Utility Function « PHP






Using include 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

    include ('library.inc');     // Parentheses are optional 
    $leap = is_leapyear(2003);

?>
  
  








Related examples in the same category

1.Behavior of Files Included Using include
2.Including Other Files
3.Including files relative to the current file
4.Using include() Within a Loop
5.Using include() to Execute PHP and Assign the Return Value