·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> 关于PHP Notice: A non well formed numeric value encountered, 你知道多少

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

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23
关于php Notice: A non well formed numeric value encountered, 你知道多少

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

A non well formed numeric value encountered=>

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

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

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

如:boolimagecopymerge(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

Link: http://www.cnblogs.com/farwish/p/3791663.html

@黑眼诗人 <www.farwish.com>