<?php // your code goes here $states = 'states.txt'; $stateContents = file($states); foreach($stateContents as $line) { //перечисляем штаты строки $lineArr = explode("|", $line); //строку в массив с разд | $codes = $lineArr[1]; foreach ($codes as $code) { $allCodes = explode(",", $code); } }
Standard input is empty
Standard output is empty
PHP Warning: file(states.txt): failed to open stream: No such file or directory in /home/d1BP3l/prog.php on line 6 PHP Warning: Invalid argument supplied for foreach() in /home/d1BP3l/prog.php on line 8
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!