Strip a set of characters from a string: Difference between revisions

added php
(added php)
Line 75:
 
print stripchars("She was a soul stripper. She took my heart!", "aei"), "\n";</lang>
Output:
<pre>
Sh ws soul strppr. Sh took my hrt!
</pre>
 
=={{header|PHP}}==
<lang php><?php
function stripchars($s, $chars) {
return str_replace(str_split($chars), "", $s);
}
 
echo stripchars("She was a soul stripper. She took my heart!", "aei"), "\n";
?></lang>
Output:
<pre>
Anonymous user