function in the url would be recieved by the PHP-script as a variable, so you could do it this way:
// main program
// if the value of $funtion = writeFile then
// call the function
if (strcmp($function, 'writeFile') == 0) {
writeFile();
}
I don't see how you could invoke the function directly though.