About PHP Notice: A non well formed numeric value encountered, how much do you know_PHP Tutorial

WBOY
Release: 2016-07-13 10:27:42
Original
1367 people have browsed it

-------------------------------------------------- --------------------------------------------------

A non well formed numeric value encountered=>

From the literal meaning, you can roughly get a glimpse of some meaning: encountering a numerical value that is not well formed;

ok, we guess that one of the parameter types may be wrong. We need to pass in a numeric type but it may actually be a string.

------------------------@ chenwei ------------- --------------------------

So, to solve this problem, first check whether the parameter types passed in your custom function are consistent with those actually used.

For example: bool imagecopymerge ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int$src_x , int $src_y , int $src_w , int $src_h , int $pct );

Several of the parameters specifying position, width and height are all int (integer). If you accidentally pass in the 'px' unit, an error will be reported.

---------------------------------------- -------------------------------------------------- ----------

You can process the data in many ways before passing it in, such as:

$str = '1px';

echo intval($str);    //1

echo rtrim($str, 'px'); //1

------------------------------------------------------------------------------------------------

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/814841.htmlTechArticle---------------------------------------------------------------------------------------------- A non well formed numeric value encountered= 从词面上来理解,可以大概窥探...
Related labels:
php
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