Home  >  Article  >  Backend Development  >  defined的用法

defined的用法

WBOY
WBOYOriginal
2016-06-23 14:18:331364browse

if (!defined('IN_CB')) { die('不允许访问此页.'); }

请问这句是什么意思呢,我知道define,但是不知道defined,


回复讨论(解决方案)

http://php.net/manual/zh/function.defined.php

嗯,谢谢,我明白了,我是在一个开源的程序里看看到的,这个我学到了,如果一个页面不想被其他人直接访问,那么就用这个函数,这个好使~

if (!defined('IN_CB')) { die('不允许访问此页.'); }

如果这个常量不存在就不执行下面的,并且抛出“不允许访问此页”

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn