php – 警告:number_format()期望参数1为double,字符串给出[clo
发布时间:2020-12-13 22:14:59 所属栏目:PHP教程 来源:网络整理
导读:我的页面滑块上出现此错误: Warning: number_format() expects parameter 1 to be double,string given in /home/globalar/public_html/wp-content/themes/automotive_s1/includes/slider.php on line 30 ?php if $str = floatval($str); ($post-post_type
我的页面滑块上出现此错误:
<?php if $str = floatval($str); ($post->post_type == "gtcd") { the_title(); if (isset( $fields['price'])) { echo ' | <span class="price_slider">'.' '.$symbols['currency']; echo number_format($fields['price']).'</span> '; } else { echo ''; } 解决方法
你应该检查$fields [‘price’]里面的值.
做就是了: var_dump($fields['price']); 你可能有一些空间,而不是. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |