The
*/ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhello * 完成日期:2016年5月18日 * 版本号:V1.0 * 问题描述:PHP * 程序输入:无 * 程序输出:无 */ <?php define("PI1",3.14); $p = "PI1"; $is1 = defined($p); $is2 = defined("PI2"); var_dump($is1); var_dump($is2); ?>
defined() function can help us determine whether a constant has been defined. Its syntax format is:
bool defined(string constants_name
If it exists, it returns Boolean type true, otherwise it returns Boolean type false; (Note :bool indicates that the function return value type is Boolean)The above has introduced 2-PHP defined function, including the defined content. I hope it will be helpful to friends who are interested in PHP tutorials.