Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $arFile = array();
- $handle = fopen("table.txt", "r");
- if ($handle) {
- while (($line = fgets($handle)) !== false) {
- $pattern = '/\d+/';
- preg_match_all($pattern, $line, $matches);
- unset($matches[0][0]);
- $arFile[] = $matches[0];
- }
- fclose($handle);
- } else {
- // ошибка открытия файла
- }
- file_put_contents("table.php", '<? $arTable = ' . var_export($arFile, true) . ';');
- // сохраняем в table.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement