PHP ver gevorderde |
|
doe het anders zo:
<?php
function deleteValue($sDelete, $sString)
{
$aString = explode(',', $sString);
foreach($aString as $iKey => $sValue)
{
if($sValue == $sDelete)
{
$aString[$iKey] = '';
}
}
return implode(',', $aString);
}
?>
<?php function deleteValue($sDelete, $sString) { foreach($aString as $iKey => $sValue) { if($sValue == $sDelete) { $aString[$iKey] = ''; } } } ?>
|