twilliamson Posted February 13, 2009 Share Posted February 13, 2009 I have a Csv file with the lo range and the hi range, the street name, zipcode and the school district number low,high,streetname,zipcode,schooldistrist 100,300,Apple Ave,29070,3 I need to "search" this file. I dont have a sql server available so i would like to keep it flat file. Im trying to have a user enter a address say in three html text boxes [267] [Apple Ave] [29070] and use php to display something like this 100-300 Apple Ave 29070 District 3.... I dont know where to start. I have written to csv from php but reading is confusing me. Tripp [email protected] Link to comment https://forums.phpfreaks.com/topic/145103-read-csv-and-search-between-a-range/ Share on other sites More sharing options...
twilliamson Posted February 13, 2009 Author Share Posted February 13, 2009 how would run a conditional statement on so Apple ave? its in the [2] spot Link to comment https://forums.phpfreaks.com/topic/145103-read-csv-and-search-between-a-range/#findComment-761525 Share on other sites More sharing options...
allworknoplay Posted February 13, 2009 Share Posted February 13, 2009 how would run a conditional statement on so Apple ave? its in the [2] spot Well you would say something like: if($array[1] == "Apple Ave") Link to comment https://forums.phpfreaks.com/topic/145103-read-csv-and-search-between-a-range/#findComment-761528 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 http://php.net/file http://php.net/explode Read in the file with file() (or if it's a big file, you may want to use fread), and then explode each line. Link to comment https://forums.phpfreaks.com/topic/145103-read-csv-and-search-between-a-range/#findComment-761529 Share on other sites More sharing options...
twilliamson Posted February 13, 2009 Author Share Posted February 13, 2009 Could someone show me some code. I want to start by searching the range of street numbers. intStreet if {([0]< intStreet) if {([0]< intStreet) Print Line } elses { move to next line} } else {move to next line} Make any since? Link to comment https://forums.phpfreaks.com/topic/145103-read-csv-and-search-between-a-range/#findComment-761547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.