php Notice : Use of undefined constant solution_PHP tutorial

WBOY
Release: 2016-07-13 10:55:44
Original
1199 people have browsed it

When I was doing php, I suddenly got the error php Notice: Use of undefined constant. One is that the variable is not defined. Let’s take a look at the solution.

Error message

php Notice : Use of undefined constant

Analysis

These are PHP prompts rather than errors. PHP itself can be used directly without declaring variables in advance, but there will be prompts for undeclared variables. Generally, as an official website, prompts will be turned off, and even error messages will be turned off

Solution

How to turn off PHP prompts

Search php.ini:

 

You need to change your php.ini file
The code is as follows
 代码如下 复制代码

error_reporting = E_ALL

  改为:

  error_reporting = E_ALL & ~E_NOTICE

Copy code

error_reporting = E_ALL

Changed to:

 代码如下 复制代码
 error_reporting(0); 虽然不好弄但是可以解决问题
 error_reporting = E_ALL & ~E_NOTICE



Another alternative is

Add

to the header of each file

 代码如下 复制代码

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

Foreign reference articles

Hello,
find the word "error_reporting" in your php.ini file and make the

change like below..

The code is as follows Copy code
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT regards R.Sureshkannan
http://www.bkjia.com/PHPjc/632226.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632226.htmlTechArticleWhen I was doing php, an error like php Notice: Use of undefined constant suddenly appeared. One is that the variable is not defined. problem, let’s take a look at the solution. Error message php No...
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!