Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function csvstr_arr($string, $delimiter){
$lines=explode("\r\n",$string);
if(!$lines){
return "string contains less than two rows";
}
else{
$csvarray=array();
if(!strpos($string,$delimiter)){
return "Delmiter not found in string";
}
foreach($lines as $line){
$csvarray[]=explode($delimiter,$line);
}
return $csvarray;
}
}
$string="onevalue,2values,three values \r\n row2value1,row2value2,row2value3 \r\n row3value1, row3value2, row3value3";
echo "<pre>";
print_r(csvstr_arr($string,","));
echo "</pre>";
<?php
$thestr = "\"fred\", 4, 89, \"hey there\"";
$displayit = array();
$displayit = str_getcsv($thestr);
echo ' <BR>';
print_r($displayit);
?>