in PHP I am reading a text file with many lines, where each $line have the format: text1,text2,text3,.. so, i am reading with fgets() each line, but i dont know how to assign each variable of the line like $text1 = text1, $text2=text2, etc.. Any help? thanks in advance
Asked
Active
Viewed 43 times
-3
-
1take a look at the 'explode' function [here](http://php.net/manual/en/function.explode.php). – ethrbunny Nov 12 '14 at 18:41
-
possible duplicate of [How can I split a comma delimited string into an array in PHP?](http://stackoverflow.com/questions/1125730/how-can-i-split-a-comma-delimited-string-into-an-array-in-php) – andy Nov 12 '14 at 18:43
-
thanks! explode is working fine! – West14 Nov 12 '14 at 22:17