Friday, July 31, 2009

numbers from 001 to 999

the numbers from 001 to 999

echo "<?php for(\$i=1; \$i<=999; \$i++){ echo sprintf('%03d',\$i).chr(10);} ?>"|php

The \ has to go before the $ character because $i can refer to the command line environment variable $i, so we escape it with \$i in order to pass it straight through to the php parser.

No comments: