robert_gsfame Posted January 20, 2011 Share Posted January 20, 2011 this question seems so stupid, but i really want to know the best way to write this code. let say i have this code: if(empty($num)) { header("Location:index.php"); } is it okay if i write it down like this? if(empty($num)) { header("Location:index.php"); } i mean there is a whitespace behind header() thx in advance Quote Link to comment Share on other sites More sharing options...
Garethp Posted January 20, 2011 Share Posted January 20, 2011 Yes. Any whitespace INSIDE the <?php ?> tags that isn't echoed doesn't go to the browser. So long as the BROWSER doesn't receive any characters at all, you can use header Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted January 20, 2011 Author Share Posted January 20, 2011 thx garethp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.