I would like to know in the following case which is a better option:
In the PHP script, if the $fileSize variable is larger than 100, I stop the script;
$fileSize
It depends...if your script is intended to do nothing else but output a message, and you don't want the script to do anything afterwards, exit() will work. Otherwise, use return.