"; if ($first_line == true) { echo "first_line =>"; if ( $first_column_line == true ) { echo "first_column"; $first_column_line = false; }else { $index = explode("/",$column); echo "opening ../lang/" . $index[0]; $fhl[++$i] = fopen("../lang/" . $index[0], "w") or die("can't open lang/" . $index[0]); fwrite($fhl[$i], '{'); if ( $first_column == true ) { $first_column = false; }else { fwrite($fhIndex, ","); } fwrite($fhIndex, '"' . $index[0] . '":"' . $index[1] . '"'); } echo EOL; }else { if (!empty($fhIndex)) { fclose($fhIndex); unset($fhIndex); } echo "not first_line =>"; if ( $first_column == true ) { $first_column = false; $index = $column; echo "first_column = ". $index . "=>"; }else { $i++; if ($first_object == true) // insère la virgule { echo "first_object =>"; }else { echo "not first_object =>"; fwrite($fhl[$i], ", "); } fwrite($fhl[$i], '"' . $index . '":"' . $column .'"'); //écrit l'objet json echo "writing " . '"' . $index . '":"' . $column .'"'; } echo EOL; } echo EOL; } if ($first_line == false) { $first_object = false; } $first_line = false; } fclose($fh); foreach( $fhl as $fhx) { fwrite($fhx, '}'); fclose($fhx); } ?>