0

i want to import a file and then use the items in variables
i have the file imported i also turn it into chunks with explode
now i tried preg_replace to get rid of certain charaters i need to get rid of " character from the file then split it by , and ideas or a kick in the right direction would be appreciated
i also tryed to preg by , but still cnat get it right

my code now

//==========================================================================================================
// READ CVS FILE (GET DATA FROM FILE)
//==========================================================================================================

$myFile = "products.csv";
$fh = fopen($myFile, 'r');
$theStuff = fread($fh, filesize($myFile));
fclose($fh);
//echo $theStuff;


//==========================================================================================================
// explode data into arrays
//==========================================================================================================
//preg_replace(',', "", $thestuff);

$chunks = explode(',', $theStuff);
echo $chunks[1];
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by HITMANOF44th
0

suprisingly i did not find that in my travels of the world wide web thanks for the reply

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.