title: PHP global variable is undefined inside a function even if global keyword is used
body: <p>Yes I know global variables is a bad practice, but ease up on that rule for this one :P</p>
  
  <p>My code:</p>
  
  <pre><code>include('something.php'); //where $from is declared
  
  function myfunc() {
      global $from;
      echo "from(myfunc)=$from&lt;br /&gt;";
      ...
  }
  
  echo "from=$from&lt;br /&gt;";
  myfunc();
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>from=2010-05-01
  from(myfunc)=
  </code></pre>
  
  <p>What's going on? :(</p>
  
  <p>EDIT:
  If it helps, all the code above is inside a view file in CodeIgniter ( and yes, I know functions are not supposed to be inside views :P )</p>