Crew algemeen |
|
Overgestaan ==>Overgeslaan
Dit heb ik net ff in elkaar gezet:
$sString = 'tekst, tekst, tekst, "tekst, tekst", tekst, tekst';
preg_match_all('/"(.*)"/', $sString, $aMatches);
foreach ($aMatches[0] as $sKey => $sValue) {
$sString = str_replace($sValue, '$' . $sKey . '$', $sString);
}
$aParts = explode(', ', $sString);
$i = 0;
foreach ($aParts as $sKey => $sValue) {
if ($sValue == '$'. $i . '$') {
$aParts[$sKey] = $aMatches[0][$i++];
}
}
print_r($aParts);
$sString = 'tekst, tekst, tekst, "tekst, tekst", tekst, tekst'; foreach ($aMatches[0] as $sKey => $sValue) { $sString = str_replace($sValue, '$' . $sKey . '$', $sString); } $i = 0; foreach ($aParts as $sKey => $sValue) { if ($sValue == '$'. $i . '$') { $aParts[$sKey] = $aMatches[0][$i++]; } }
|