fork(1) download
  1. <?php
  2. $text = "1*10
  3. 11*20
  4. 21*30
  5. 31*40
  6. 41*50";
  7. $textAr = explode("\n", str_replace("\r", "", $text));
  8. $textAr = array_filter($textAr, 'trim');
  9.  
  10. foreach ($textAr as $line) {
  11. $pieces = explode("*", $line);
  12. list($first, $last) = array_pad(explode('*', $line, 2), 2, null);
  13.  
  14. $add = 1;
  15. for ($i = $first; $i <= $last; $i += $add) {
  16. $array[] = array(
  17. 'count' => $i
  18. );
  19. }
  20.  
  21.  
  22. }
  23.  
  24. $codes = $array;
  25. foreach ($codes as $code) {
  26. echo $code['count'];
  27. echo "<br>";
  28. }
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br>31<br>32<br>33<br>34<br>35<br>36<br>37<br>38<br>39<br>40<br>41<br>42<br>43<br>44<br>45<br>46<br>47<br>48<br>49<br>50<br>