我在下面有这段代码,如果我想控制数字之间的间距,我该怎么做。1 0 , 5 6 5 , 6 6 0 。8 8(当前 1 个空格) - 这是当前输出,我希望每个数字之间有更多空格,可能是 3 个或更多空格。先感谢您。 <?php session_start() ; ?> <?php require "../db_connection304.php" ; ?> <?php require_once('../../bus_partners/fpdf/fpdf/fpdf.php'); require_once('../../bus_partners/fpdf/fpdi/fpdi.php'); $pdf = new FPDI(); if (isset($_POST["submit"])) { $payroll_month = mysqli_real_escape_string($connection304, $_POST['payroll_month']); } $year = preg_split("/[-_ ]+/", $payroll_month) ; $year = $year[1] ; $payrolldate1 = str_replace('_','', $payroll_month) ; $payroll_date2 = date_create_from_format("FjY","$payrolldate1") ; $monthly_statutory = date_format($payroll_date2,"m") ; $query = "SELECT SUM( GROSS_PAY ) AS gross_pay FROM ".$_SESSION['$company_code']."_".$year." WHERE MONTH(PAYROLL_PERIOD) = '{$monthly_statutory}' "; $result_gross_pay = mysqli_query($connection304,$query) ; while($row_gross_pay = mysqli_fetch_array($result_gross_pay)) { $gross_pay = $row_gross_pay['gross_pay'] ; }$gross_pay = number_format($gross_pay,2 ) ;$gross_pay_withspace = chunk_split($gross_pay,1,' ') ;
1 回答
慕丝7291255
TA贡献1859条经验 获得超6个赞
代替
chunk_split($gross_pay,1,' ') ;
和
chunk_split($gross_pay,1," ") ; //no. of " " varies based on requirement
- 1 回答
- 0 关注
- 106 浏览
添加回答
举报
0/150
提交
取消