I m curious to know that is there any diffrence between
header('Location:index.php'); // using capital `L`
exit(); // using parenthesis
AND
header('location:index.php');
exit;
which one we should recommend to use?
I m curious to know that is there any diffrence between
header('Location:index.php'); // using capital `L`
exit(); // using parenthesis
AND
header('location:index.php');
exit;
which one we should recommend to use?
According to the actual RFC for HTTP, you should use an uppercase "L", and an absolute URI:
header('Location: http://www.mysite.com/index.php');
As far as exit
vs exit()
, there is no difference. It is a language construct, not a function, and the parenthesis are optional. You may even use exit 0
or exit(0)
.