vovus
Новичок
Список из файла в массив
Есть файл discs.dat с такими данными: CMS::CMS::CMS::CMS::CMS::70::71::72::73::74::CMS 40::CMS 61::CMS 66::CMS 71::CMS 77::-::-::-::-::- и т.д. до конца файла...
а это кусок кода, считывающего строки:
$general="discs.dat";
$general_file = file($general); $lines = count($general_file);
for ($i = 0; $i <= $lines; $i++){
list($disc1naz_t,$disc2naz_t,$disc3naz_t,$disc4naz_t,$disc5naz_t,$disc1ris_t,$disc2ris_t,$disc3ris_t,$disc4ris_t,$disc5ris_t,,$disc2info_t,$disc3info_t,$disc4info_t,$disc5info_t,$disc1dop_t,$disc2dop_t,$disc3dop_t,$disc4dop_t,$disc5dop_t)=explode("::", $general_file[$i]); }
как мне превратить данные в массив такого вида? : $filelist=array ("CMS::70::CMS 40::-","CMS::71::CMS 61::-","CMS::72::CMS 66::-","CMS::73::CMS 71::-","CMS::74::CMS 77::-", ит.д. в зависимости от количества строк);
БУДУ БЛАГОДАРЕН ЗА ЛЮБУЮ НОРМАЛЬНУЮ ПОДСКАЗКУ
Есть файл discs.dat с такими данными: CMS::CMS::CMS::CMS::CMS::70::71::72::73::74::CMS 40::CMS 61::CMS 66::CMS 71::CMS 77::-::-::-::-::- и т.д. до конца файла...
а это кусок кода, считывающего строки:
$general="discs.dat";
$general_file = file($general); $lines = count($general_file);
for ($i = 0; $i <= $lines; $i++){
list($disc1naz_t,$disc2naz_t,$disc3naz_t,$disc4naz_t,$disc5naz_t,$disc1ris_t,$disc2ris_t,$disc3ris_t,$disc4ris_t,$disc5ris_t,,$disc2info_t,$disc3info_t,$disc4info_t,$disc5info_t,$disc1dop_t,$disc2dop_t,$disc3dop_t,$disc4dop_t,$disc5dop_t)=explode("::", $general_file[$i]); }
как мне превратить данные в массив такого вида? : $filelist=array ("CMS::70::CMS 40::-","CMS::71::CMS 61::-","CMS::72::CMS 66::-","CMS::73::CMS 71::-","CMS::74::CMS 77::-", ит.д. в зависимости от количества строк);
БУДУ БЛАГОДАРЕН ЗА ЛЮБУЮ НОРМАЛЬНУЮ ПОДСКАЗКУ
- пыхнул я чуток и сам догадался, чего мне в жизни не хватало... :