Chrex 0 Report post Posted March 28, 2015 Hi guys, here is what I have: an excel sheet (XLS, 4MB) with postal codes in the first column more data in the other columns here is what I need: looking for the postal code in the excel sheet get the information to this postal code from the other columns work with the other information (use them as variables) example: PC | A | B | C 1234 | 2.3 | 3.5 | 1.1 2345 | 3.3 | 3.3 | 7.8 ---> If I have the postal code 2345, I want to create the variables $a=3.3 ; $b=3.3 ; c=7.8 in PHP here is what I heard about: phpexcel.php php_excelReader here are my questions: What would you recommend (phpexcel.php or php_excelReder or something else)? Is there a tutorial on w3schools (I couldn´t find one)? Can you provide some code? Thanks for your help! Quote Share this post Link to post Share on other sites
Chrex 0 Report post Posted March 29, 2015 Got it <?php$csv = array();$file = fopen('myfile.csv', 'r');while (($result = fgetcsv($file)) !== false){ $csv[] = $result;}/*******************************************/$i="0";for ($c=0; $csv[$c][0] =< $postalcode; $c++){$i=$i+1; }$postalcoderow = $i;/*******************************************/fclose($file);/*echo '<pre>';print_r($csv[$postalcoderow][$columnnumber]);echo '</pre>';*/?> Quote Share this post Link to post Share on other sites