- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
- str_replace: documentation ( source)
<?php
$re = '/\"(.*?)\",\"(.*?)\"/s';
$str = '"Name","Address"
"John Doe","5111 Fury Rd
Santa Cruz"
"Jane Doe","321 Tess St Texas"
"Josh Doe","653 1st St
Orlando Florida
United States"';
preg_match_all($re, $str, $matches);
// Print the entire match result
foreach($matches[2] as &$value){
$value = str_replace(PHP_EOL, " ", $value);
}
var_dump($matches);