Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function filter_num($input){
- $num = str_replace(' ', '-', $input);
- return preg_replace('/[^0-9]/', '', $num);
- }
- echo filter_num("0h1e2l3l4o6")
- //result = 0123456
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement