How would I make it so when a number is displayed it always displays 7 digits and if there is no di git to display to display a 0, in the empty space befor the number.
so numbers will always appear as 0000001 or 0001976 or 2224234
behold the might of printf :
for ( $x = 0; $x < 50; $x++ ) { echo "X: $x <br />\n"; printf( "%07d <br />\n", $x ); }
How's It Work😃
Originally posted by konigwolf How's It Work😃
As described on the [man]printf[/man] manual page.
if it isn't entirely obvious, then RTFM. i posted the link for f*ck's sake.