benphp Posted April 27, 2008 Share Posted April 27, 2008 Is there a way to do this - or do you have to use regular expressions to filter out results? Link to comment https://forums.phpfreaks.com/topic/103103-can-you-query-a-csv-file/ Share on other sites More sharing options...
mrdamien Posted April 27, 2008 Share Posted April 27, 2008 Well, you can 'query' a CSV file per se, but you can find it with regular expressions, or simply by going through each line. $file = file('csv.txt'); foreach($file as $line){ list($id, $name, $addess) = explode(",", $line); if($id == 123){ } } Link to comment https://forums.phpfreaks.com/topic/103103-can-you-query-a-csv-file/#findComment-528163 Share on other sites More sharing options...
benphp Posted April 27, 2008 Author Share Posted April 27, 2008 Thanks - I'll use that. Looks like it will boil down to regular expressions. I must get better at them. Link to comment https://forums.phpfreaks.com/topic/103103-can-you-query-a-csv-file/#findComment-528170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.