title: How would I call a function in another file?
body: <p>For example, I have a file error-status.php, which includes a 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>...</p>
  
  <p>How do I call that function from a different PHP file after invoking <code>require_once</code>?</p>
  
  <pre><code>require_once('error-status.php');
  </code></pre>