Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHPで、テキストファイルを開いて読み込んで、文字列型の各行と配列内の要素を作成するにはどうすればよいですか?
私の計画は、 a を使用しforeachて配列を移動し、 を使用in_array()してファイルの内容から単語を探すことです。
foreach
in_array()
使用file():
file()
$lines = file('path/to/file'); foreach($lines as $line) { //enjoy }