Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string = preg_replace('/W+$/', '', $string); // converts `#str|ng#` to `#str|ng`
- $string = preg_replace('/^W+/', '', $string); // converts `#str|ng#` to `str|ng#`
- $string = preg_replace('/^W+|W+$/', '', $string);
- $string = preg_replace('/^[W_]+|[W_]+$/', '', $string);
- $string = trim($string, "#");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement