PHP - parsing a txt file
问题 I have a .txt file that has the following details: ID^NAME^DESCRIPTION^IMAGES 123^test^Some text goes here^image_1.jpg,image_2.jpg 133^hello^some other test^image_3456.jpg,image_89.jpg What I'd like to do, is parse this ad get the values into a more readable format, possibly into an array if possible. Thanks 回答1: You can do that easily this way $txt_file = file_get_contents('path/to/file.txt'); $rows = explode("\n", $txt_file); array_shift($rows); foreach($rows as $row => $data) { //get row