Reputation: 1279
I would like to convert my rpt file to array. The file is divided with commas. Of course that's easy part. The second thing I need to convert it into multidimensional array, which probably is also easy but I got stuck in it. I need to make it that each line of the file will be next row.
I'm looking in my head but I don't know how to solve it.
I hope you'll help me!
Upvotes: 0
Views: 44
Reputation: 574
$contents = file($path);
foreach($contents as &$row){
$row = explode(",",$row);
}
file()
reads the file into an array, one line is one array element.
Upvotes: 1