php - 我应该在调用位置:标头后调用 exit() 吗?
2022-08-30 08:07:33
调用重定向函数标头后,是否应调用 exit?
<?php // fileA
$urlFailToGoTo = '/formerror.php';
if (sth)
{
header(sprintf("Location: %s", $urlFailToGoTo));
exit(); //should I call exit() here? or return?
}
?>
谢谢