PHP头条
热点:

关于PHP Notice: A non well formed numeric value encountered, 你知道多少


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

A non well formed numeric value encountered=>

从词面上来理解,可以大概窥探到一些意思:遇到了形成不是很好的数值 ;

ok, 我们猜想可能是某个参数类型不对,需要传入数值型而实际可能是字符串。

------------------------@ chenwei <www.chenwei.ws>----------------------------------

那么,解决这个问题先去看你自定义的函数,传入的参数类型和实际使用的是否一致。

如: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 );

其中几个指定位置和宽高的参数都为int(整型),如果不小心传入带'px'单位的,那么报错了。

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

你可以有多种方法对数据进行处理后再传入,如:

$str = '1px';

echo intval($str);    //1

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

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

www.phpzy.comtrue/php/10641.htmlTechArticle关于PHP Notice: A non well formed numeric value encountered, 你知道多少 ---------------------------------------------------------------------------------------------- A non well formed numeric value encountered= 从词面上来理解,...

相关文章

相关频道:

PHP之友评论

今天推荐