Reputation: 23
I need this ans :
Array
(
[0] => Customer First Name
[1] => Customer Last Name
[2] => Date
[3] => Is Anonymous
[4] => Rating
[5] => Title
[6] => Review
[7] => EMail
)
Array
(
[0] => TODD
[1] => JACKMAN
[2] => 6/17/13
[3] => FALSE
[4] => 5
[5] => Outstanding service as always!
[6] => Outstanding service as always!
[7] => [email protected]
)
Array
(
[0] => Gary
[1] => Peters
[2] => 6/19/13
[3] => FALSE
[4] => 5
[5] => From my description Ari suggested...
[6] => From my description Ari suggested what the problem might be. It was as he suspected. Got a replacement part at the best price. Installation was prompt and successful. Still one of the best places to go for auto repair.
[7] => [email protected]
)
But i am getting :
Array
(
[0] => Customer First Name
[1] => Customer Last Name
[2] => Date
[3] => Is Anonymous
[4] => Rating
[5] => Title
[6] => Review
[7] => EMail
TODD
[8] => hjk
[9] => JACKMAN
[10] => 6/17/13
[11] => FALSE
[12] => 5
[13] => Outstanding service as always!
[14] => Outstanding service as always!
[15] => [email protected]
Kliop
[16] => Gary
[17] => Peters
[18] => 6/19/13
[19] => FALSE
[20] => 5
[21] => From my description Ari suggested...
[22] => From my description Ari suggested what the problem might be. It was as he suspected. Got a replacement part at the best price. Installation was prompt and successful. Still one of the best places to go for auto repair.
[23] => [email protected]
)
Please help me...
Upvotes: 2
Views: 49
Reputation: 1957
Please try
$lines = file('test.csv');
foreach ($lines as $line_num => $line) {
$data = explode(',',$line);
echo "<pre>";print_r($data);
}
hope it's helpfull for you
Upvotes: 1