To immediately answer your question, if you pass a GET variable through file_get_contents
, the server will process that value as if an outside source had requested it:
file_get_contents( "http://www.example.com/runSomething.php?foo=132" );
In the above example, runSomething.php has now received the information $_GET[ "foo" ] = 123. This is a bit awkward, though. It also will not technically free any resources, you'll now have one script waiting for a response, and another script taking up the same memory which would normally have been used by your original script. That said, you may be spawning another instance of PHP, which could help.
You are much better off if you can encapsulate the functionality into two objects or two functions and then call them in succession. If this is done through oop, you'll be able to call unset
to remove the first object from memory.
If this is something which can happen asynchronously, I agree with Bart. cron is very powerful, and, if you're using Linux, you'll even be able to call PHP from the command line so you won't have to learn much beyond what you already know.