defined的用法

WBOY
Release: 2016-06-23 14:18:33
Original
1383 people have browsed it

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

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


回复讨论(解决方案)

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!