How do you print 1 to 100 without using loop in php?

1 answer

Answer

1292612

2026-08-02 20:30

+ Follow

The best way to print the numbers 1 to 100 in PHP without using a loop is with the following code:

echo implode("<br>", range(1,100));

You can replace the <br> with anything that you want to separate the numbers, such as dashes. I used a line-break in the example.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.