Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $csv_field = preg_replace('/"(.|$)/', '1', $csv_field);
- preg_replace('/([W]){2}b/', '1', $csv)
- $data = file_get_contents('test.csv');
- $pieces = explode("n", $data);
- $html .= "<table border='1'>n";
- foreach (array_filter($pieces) as $line) {
- $html .= "<tr>n";
- $keywords = preg_split('/,(?=(?:[^"]*"[^"]*")*(?![^"]*"))/', $line,-1,PREG_SPLIT_DELIM_CAPTURE);
- foreach ($keywords as $col) {
- $html .= "<td>".trim($col, '"')."</td>n";
- }
- $html .= "</tr>n";
- }
- $html .= "</table>n";
- preg_split('/,(?=(?:[^"]*"[^"]*")*(?![^"]*"))/', $line,-1,PREG_SPLIT_DELIM_CAPTURE);
- preg_split('/'.$seperator.'(?=(?:[^"])*(?![^"]))/', $line,-1, PREG_SPLIT_DELIM_CAPTURE);
Add Comment
Please, Sign In to add comment