php function call from external PHP
<p>I want to call function in PHP i use require_once for this .... 
now i want to call the function in a particular event how it is done ?</p>

<p>For example I have an function</p>

<pre><code>function validateHostName($hostName) {
    if ((strpbrk($hostName, '`~!@#$^&amp;*()=+.[ ]{}\\|;:\'",&lt;&gt;/?') == FALSE) &amp;&amp; !ctype_digit($hostName) &amp;&amp; eregi("^([a-z0-9-]+)$", $hostName) &amp;&amp; ereg("^[^-]", $hostName) &amp;&amp; ereg("[^-]$", $hostName)) {
        return true;
    }
    else return false;
}
</code></pre>

<p>in error-status.php file .. (external file)
now i want to cal this file in 2.php in between here</p>

<pre><code>else if ($apply == "Add") {
    //$length=$doc-&gt;getElementsByTagName('Server')-&gt;length;
    if ($addntp == "") {
        seterror("0:|: :|: Add NTP server");

        //$error_text="NTP server already added"."\n"."Exiting ..."; 
        //AddLog("timeconfig.php",$error_text,ERR_INFO);
        header("Location: datetime.php");
        exit;
    } 
</code></pre>

<p>can u help me fast ... how it is call ... i use require function for include .... </p>
