Love2c0de
Members
-
Joined
-
Last visited
Reputation Activity
-
Love2c0de got a reaction from drt_t1gg3r in What you prefer?Can't beat a good old basic text editor. Notepad++ wins all day long!
-
Love2c0de reacted to Keo in Need little help with PHPIf you have integers instead of strings here is my advice:
$Variables = array(9,6,12,26,112); sort($Variables); foreach ( $Variables as $v ){ echo str_pad($v, 2, 0, STR_PAD_LEFT)."<br />"; }
The str_pad() function fills the zeros for you where you need, and if you want you can increase the number of zeros by increasing the second parameter of the function. (http://php.net/manual/en/function.str-pad.php)