I've tried this question on two forums and have been told this is the best place for this type of question. I'm trying to print from 0 to 1000 then back to 0 again (and all numbers in-between), printing 1000 only once. Also, each number must be on a separate line using vanilla PHP.
My current code is 60 characters long. Is there a way to do the same thing but in less characters?
PHP, 60 bytes
echo implode("<p>",array_merge(range(0,999),range(1000,0)));
<?php
around the code and the<p>
for newlines. You can edit the code and the press the link icon at the top, and the copy-paste option for "Code Golf submission" can be pasted into your question. \$\endgroup\$array_merge
which your code uses. \$\endgroup\$<p>
? \$\endgroup\$