Skip to content

Commit a6f5c9f

Browse files
committed
Use sprintf() instead of long concatenation
1 parent 5b3b63e commit a6f5c9f

File tree

1 file changed

+8
-4
lines changed
  • samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs

1 file changed

+8
-4
lines changed

samples/tutorials/php/2.0 PHP Server programming - Stored procedures, Transactions, and UDFs/test.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,14 @@
145145
break;
146146
}
147147
$ctr++;
148-
echo $row['SalesOrderID'] . str_repeat(' ', 13) . $row['CustomerID'] . str_repeat(
149-
' ',
150-
11
151-
) . $row['TotalItems'];
148+
echo sprintf(
149+
'%s%s%s%s%s',
150+
$row['SalesOrderID'],
151+
str_repeat(' ', 13),
152+
$row['CustomerID'],
153+
str_repeat(' ', 11),
154+
$row['TotalItems']
155+
);
152156
echo('<br/>');
153157
$productCount++;
154158
}

0 commit comments

Comments
 (0)