Orionsbelter Posted December 28, 2012 Share Posted December 28, 2012 I'm currently trying to use the following code: $arrResult = array(); $arrLines = file('ProductAll.csv'); foreach($arrLines as $line) { $arrResult[] = explode( ',', $line); $name=$arrResult[0]; $description=$arrResult[1]; $brand=$arrResult[2]; $price=$arrResult[3]; $RRP=$arrResult[4]; $hidden=$arrResult[5]; $Image1Address=$arrResult[6]; $Image2Address=$arrResult[7]; $Image3Address=$arrResult[8]; $Image4Address=$arrResult[9]; $Image5Address=$arrResult[10]; However i just get the result "Array" where am i going wrong? Quote Link to comment https://forums.phpfreaks.com/topic/272452-php-csv-files-and-mysql/ Share on other sites More sharing options...
drewdan Posted December 28, 2012 Share Posted December 28, 2012 can you print_r($arrResult) and tell us what is displayed? Quote Link to comment https://forums.phpfreaks.com/topic/272452-php-csv-files-and-mysql/#findComment-1401857 Share on other sites More sharing options...
Barand Posted December 28, 2012 Share Posted December 28, 2012 $arrResult[] = explode( ',', $line); Remove the "[]" Quote Link to comment https://forums.phpfreaks.com/topic/272452-php-csv-files-and-mysql/#findComment-1401873 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.