If I want to execute a php script, i just point the browser to www.something.com/myscript.php
But if i want to execute a specific function inside
You could do something like this (not recommended for security reasons): www.exampe.com/myscript.php?run=getNames
then:
You would be better off using a php class instead of trying to call a function on the global namespace because they could call a potenitally dangerous function or call a function you don't want them to see the result to:
$_GET['run']();
} else {
echo 'Function not found';
}
This also wouldn't allow the class's private functions to be called, etc.