Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active February 6, 2016 12:45

Revisions

  1. kurozumi revised this gist Feb 6, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions regexiterator-decimal.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    <?php

    $it = new RegexIterator(new SplFileObject("sample.txt", "r"), '/^\d*$/');
    $file = new RegexIterator(new SplFileObject("sample.txt", "r"), '/^\d*$/');

    foreach($it as $line)
    foreach($file as $line)
    {
    var_dump($line);
    }
  2. kurozumi created this gist Feb 6, 2016.
    8 changes: 8 additions & 0 deletions regexiterator-decimal.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <?php

    $it = new RegexIterator(new SplFileObject("sample.txt", "r"), '/^\d*$/');

    foreach($it as $line)
    {
    var_dump($line);
    }