Yes I know global variables is a bad practice, but ease up on that rule for this one :P
My code:
include('something.php'); //where $from is declared
function myfunc() {
global $from;
echo "from(myfunc)=$from<br />";
...
}
echo "from=$from<br />";
myfunc();
The result is:
from=2010-05-01
from(myfunc)=
What's going on? :(
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 )