1 2 3 4 5 6 7
<?php $first = true; foreach(range(1, 10) as $num){ if ($first) $first = false; else echo '|'; echo $num; }
1
1|2|3|4|5|6|7|8|9|10