LoginSignup
24
20

More than 5 years have passed since last update.

foreachでの指定回数ループ

Posted at
PHP
<?php
foreach(range(0,3) as $i){
  echo $i.chr(10);
}
output
0
1
2
3

これでfor文はいらない

24
20
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
20