我想知道在下面的情况下,这是一个更好的解决方案:
在PHP脚本中,如果fileSize大于100,那么我停止脚本。
...
if ($fileSize > 100) // case I
{
$results['msg'] = 'fileSize is too big!';
echo json_encode($results);
exit();
}
?>
...
if ($fileSize > 100) // case II
{
$results['msg'] = 'fileSize is too big!';
exit( json_encode($results) );
}
?>
...
if ($fileSize > 100) // case III
{
$results['msg'] = 'fileSize is too big!';
return( json_encode($results) );
}
?>
这是最好的解决方案?
谢谢