Anonymous user
Strip a set of characters from a string: Difference between revisions
Strip a set of characters from a string (view source)
Revision as of 03:41, 8 June 2011
, 13 years agoadded 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>
|