Use sprintf() instead of long concatenation

This commit is contained in:
Marc Würth
2020-04-23 21:51:37 +02:00
parent 5b3b63ee5a
commit a6f5c9f908
@@ -145,10 +145,14 @@ while ($row = sqlsrv_fetch_array($getProducts, SQLSRV_FETCH_ASSOC)) {
break;
}
$ctr++;
echo $row['SalesOrderID'] . str_repeat(' ', 13) . $row['CustomerID'] . str_repeat(
' ',
11
) . $row['TotalItems'];
echo sprintf(
'%s%s%s%s%s',
$row['SalesOrderID'],
str_repeat(' ', 13),
$row['CustomerID'],
str_repeat(' ', 11),
$row['TotalItems']
);
echo('<br/>');
$productCount++;
}