dongqian9013 2013-07-22 14:48
浏览 14
已采纳

PHP header()函数

I am trying to integrate a website from a partner of my company, and I running into this line here:

header("Location: field/index.php", overwrite); 

I browsed the PHP manual of header() function, but can't find a parameter called overwrite. Can someone give me any clue?

  • 写回答

4条回答 默认 最新

  • dqyhj2014 2013-07-22 15:00
    关注

    It (overwrite) could be a constant, for example

    define('overwrite', true);
    header("Location: field/index.php", overwrite);
    

    In this case overwrite represents Boolean true and which is being used to replace a previous header.

    Though, constants should be declared using uppercase letters but it doesn't throw any errors if someone uses lowercase letters instead. Recommended way to define a constant is

    defined('OVERWRITE') or define('OVERWRITE', TRUE);
    

    It's worth mentioning that, any constant defined this way is available globally, throughout the script/application and basically developers define constants at the very beginning of script or an application and it could be defined in a different file (which is included/executed on start up) so, you may don't see it in the current script.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部