I normally put all functions in separate files, but I'm imagining ways to put everything in one file.
You could probably send the name of the needed PHP function along with each ajax-call and write something like the following in the PHP-file:
if($_POST['function_name'] == 'myfunction'){
myfunction();
}
function myfunction()
{
echo 'This to be echoed.'
}
Somehow that feels wrong. So, what is your opinion? All functions in one file or all separated?