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 Link to comment https://forums.phpfreaks.com/topic/225051-header-simple-question/ 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 Link to comment https://forums.phpfreaks.com/topic/225051-header-simple-question/#findComment-1162346 Share on other sites More sharing options...
robert_gsfame Posted January 20, 2011 Author Share Posted January 20, 2011 thx garethp Link to comment https://forums.phpfreaks.com/topic/225051-header-simple-question/#findComment-1162347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.