Last active
February 6, 2016 12:45
-
-
Save kurozumi/c2e37e9f6e5ff7b4e174 to your computer and use it in GitHub Desktop.
【PHP】RegexIteratorクラスを使ってファイル内の数字の行だけ取得する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = new RegexIterator(new SplFileObject("sample.txt", "r"), '/^\d*$/'); | |
foreach($file as $line) | |
{ | |
var_dump($line); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment