title: undefined function (PHP)
body: <p>I'll appreciate if somebody help me to find what is wrong in this code:</p>
  
  <p>The function 'freightPrice' (shown below) is in a file called 'freight.php' and this file is required_once on 'main.php'. 
  When I call the function 'freightPrice' from 'main.php' I receive the messages below: </p>
  
  <p>main.php - "Undefined function 'FreightPrice'".</p>
  
  <p>freightPrice.php - "Variable 'FreightPrice' might have not been defined".</p>
  
  <p>freightPrice.php - "Undefined variable 'FreightPrice'".</p>
  
  <pre><code>&lt;?php
  
  // file freightPrice.php
  
  // FREIGHT CALCULATION
  
  function FreightPrice($weight) {
  
      $PriceList = array(
          0 =&gt; 0,
          1 =&gt; 50.65,
          2 =&gt; 52.51,
          3 =&gt; 55.47,
          4 =&gt; 58.43,
          5 =&gt; 61.39,
          6 =&gt; 63.21,
          7 =&gt; 66.01,
          8 =&gt; 68.82,
          9 =&gt; 71.63,
          10 =&gt; 74.40
       );
  
      for ($i = 0; $i &lt;= 66; $i++) {
          if ($i == round($weight, 0)) {
              $freightPrice = $PriceList[$i];
              break;
          }
      }
  
      return $freightPrice;
  
  }
  
  freightPrice(60);
  echo $freightPrice;
  
  ?&gt;
  </code></pre>