/ Published in: PHP
Looks for $chars in $subject and removes any preceding and succeeding whitespace from the provided characters. It works much like trim(), except it trims characters instead of the string itself.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function trimchars($chars, $subject) { } # V # a b c d e => a bcd e trimchars('c', 'a b c d e'); # V V # 23 + 2 = 25 => 23+2=25 trimchars('+=', '23 + 2 = 25'); # V V V V V # body{background:#fff;color:#fff;} trimchars('{}:;', 'body { background: #fff; color: #fff; }');