ok, so you created two files (per JAM's post) one called "foo.php" and one called "somethingelse.php" and somethingelse.php has:
and foo.php has:
Code: Select all
function hi(){
echo "hello there";
}
and when you refresh you get an error that you can't redecalre the function?
sorry for being so mundane here, but just want to make sure we're all on the same page.
if you did indeed to all of that just like that: try using include_once() or require() or include() and see if you have the same result.
by all rights, the above should work and I don't have an explanation for you as to why it's not, first thing that comes to mind is some kind of caching issue maybe in your php.ini (espcially if it worked fine with php4.x) that leads me to believe it's not a server setting.
off the top of my head I don't knwo what it could be in php.ini that would keep a persistant copy of your function from one page refresh to the next though, I'll dig a little deeper and see if I can't find something, in the mean time try what I suggested and see if you have any better results.