abs():参数 #1 ($num) 必须为 int|float 类型,给定字符串
我想预览PDF,但在更新到PHP 8和一些软件包更新后不打开。
此代码来自Laravel
function konversi($x)
{
$x = abs($x);
$angka = array("", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh", "Delapan", "Sembilan", "Sepuluh", "Sebelas");
$temp = "";
> if ($x < 12) {// Notif from laravel in this line
$temp = " " . $angka[$x];
} else if ($x < 20) {
$temp = konversi($x - 10) . " Belas";
} else if ($x < 100) {
$temp = konversi($x / 10) . " Puluh" . konversi($x % 10);
} else if ($x < 200) {
$temp = " Seratus" . konversi($x - 100);
} else if ($x < 1000) {
$temp = konversi($x / 100) . " Ratus" . konversi($x % 100);
} else if ($x < 2000) {
$temp = " Seribu" . konversi($x - 1000);
} else if ($x < 1000000) {
$temp = konversi($x / 1000) . " Ribu" . konversi($x % 1000);
} else if ($x < 1000000000) {
$temp = konversi($x / 1000000) . " Juta" . konversi($x % 1000000);
和此Notif预览,键入错误
abs():参数#1($ num)必须是类型int | float,字符串给定(查看:c:c:\ users \ fauzan azhim \ downloads \ sci-tkdn-fixing_laporan \ sci-tki-tkdn-fixing_laporan \ sci-tkdn-fixing_laporan \ resources \ view \ laporan \ cetak_permen_1.blade.php)
I want to preview pdf, but not open after updated to php 8 and some package update.
This code notif from laravel
function konversi($x)
{
$x = abs($x);
$angka = array("", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh", "Delapan", "Sembilan", "Sepuluh", "Sebelas");
$temp = "";
> if ($x < 12) {// Notif from laravel in this line
$temp = " " . $angka[$x];
} else if ($x < 20) {
$temp = konversi($x - 10) . " Belas";
} else if ($x < 100) {
$temp = konversi($x / 10) . " Puluh" . konversi($x % 10);
} else if ($x < 200) {
$temp = " Seratus" . konversi($x - 100);
} else if ($x < 1000) {
$temp = konversi($x / 100) . " Ratus" . konversi($x % 100);
} else if ($x < 2000) {
$temp = " Seribu" . konversi($x - 1000);
} else if ($x < 1000000) {
$temp = konversi($x / 1000) . " Ribu" . konversi($x % 1000);
} else if ($x < 1000000000) {
$temp = konversi($x / 1000000) . " Juta" . konversi($x % 1000000);
And this notif preview, Type Error
abs(): Argument #1 ($num) must be of type int|float, string given (View: C:\Users\Fauzan Azhim\Downloads\sci-tkdn-fixing_laporan\sci-tkdn-fixing_laporan\resources\views\laporan\cetak_permen_1.blade.php)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
abs($ num)
<代码> abs((int)$ num)abs($num)
toabs((int) $num)