Home > Backend Development > PHP Tutorial > php 判断恒量、变量、函数是否存在

php 判断恒量、变量、函数是否存在

WBOY
Release: 2016-06-13 11:03:09
Original
721 people have browsed it

php 判断常量、变量、函数是否存在

<?php/* 判断常量是否存在*/if (defined('CONSTANT1')) {echo CONSTANT1;}//判断变量是否存在if (isset($myvar)) {echo "$myvar.";}//判断函数是否存在if (function_exists('open')) {echo "存在函数open\n";} else {echo "函数open不存在\n";}?> 
Copy after login

?

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