We know that PHP in the array to write variables in two ways, we appear that the hint is you write [name] This will have notice:use of undefined constant name-assumed name hint, the solution reference below.
Ways to turn off PHP hints
Search PHP.ini:
Today in the process of doing a hint deprecated:function set_magic_quotes_runtime () is deprecated, later on-line search to know, because the PHP 5.3 later version does not support this function.
Solutions
function Set_magic_quotes_runtime ()
This article to turn an article about Sina Weibo PHP version of the SDK caused 20007 error resolution, encounter such problems of friends can refer.
Sina Weibo has an advanced interface ' Statuses/upload_url_text ' (requires additional application
This function is powerful, compared to PHP's own function is much more powerful, this function can automatically get the character code you give, and then according to your reference to convert to the code you want, a friend can refer to the need.
In PHP's many predefined server variables, $_server["Request_uri" is often used, but this variable is supported only by Apache, so we need a more general way to get the value of Request_uri
The code is as follows
Copy Code
In PHP if we do not make any settings in general the use of the date output time is error, and very large.
Question: echo date (' O-m-j h:i ');
The code is as follows
Copy Code
〈?phpecho Date (' y-m-d h:i:s ');?〉
Today to upgrade the PHP version, suddenly appeared deprecated:function set_magic_quotes_runtime () is deprecated error, below we summarize
Cause Analysis:
Recently upgraded PHP version, the new version of PHP to Set_magic_quotes_runtime () has been
Chinese in the development of PHP often inadvertently encountered problems, today we look at Json_encode Chinese garbled solution, although the method is not very good, but can solve the problem only
The code is as follows
Copy Code
Here is a simple introduction to the PHP solution input multiple spaces only show one problem, we use CHR (32) to replace the HTML space, the need for friends can refer to.
The code is as follows
Copy Code
if
Yesterday I was doing a simple collection function I directly used the file_get_contents function, but the collection of some sites no problem, collect some network chips, and later analysis garbled is the server opened the GZIP compression function
This article to give you a detailed introduction of the uchome in the implementation of fuzzy search and the repair of the page bug some specific methods, you need to know the friend can refer to this article to set.
In the default Uchome, a
Generate a Captcha picture
Header ("Content-type:image/png");
Srand (Double) microtime () *1000000);//sow a seed that generates random numbers to facilitate the use of random number generation below
Session_Start ();//storing random numbers in
In PHP, the file_get_contents function can directly collect remote server content, and then save to a variable, the general will be file_get_contents, fsockopen and other functions of IO operation disabled, because they are afraid of being DDOS
In
Ecshop Classification tree Show solutions for all classifications if you need a friend, refer to this article.
Here's how to fix it:In goods.php, for example.
The code is as follows
Copy Code
$smarty->assign (' categories
This article mainly describes the use of the second parameter in PHP json_decode and Var_export, there is a need to understand PHP Json_decode and var_export usage of friends can also refer to the next.
Both Json_decode and Var_export have a second
Cause PHP page in Chinese garbled problem has a large number of collection and solution, resulting in Chinese garbled is generally the database and page encoding inconsistency caused by, I will give you a direct introduction to the solution. 、
1.
Today we use the regular expression to judge Preg_replace replacement of jquery escaped from the \\u5c71\\u4e1c, but some time will still appear in Chinese, the following to see the solution
The code is as follows
Copy Code
This sentence is in PHP development will touch some problems, see this hint we all know is the variable is undefined, then the following to solve the notice:undefined index method,
One, because the variable is undefined we just have to find the
When I do php suddenly appear php notice:use of undefined constant This error, one is the variable undefined problem, let's look at the solution.
Error hints
PHP Notice:use of undefined constant
Analysis
These are PHP hints rather than errors, and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service