[ create a new paste ] login | about

Link: http://codepad.org/QyrfS7WE    [ raw code | output | fork | 2 comments ]

PHP, pasted on Sep 13:
1
2
3
4
5
6
7
8
9
10
<?php

function extract_numbers($string)
{
    return preg_replace("/[^0-9]/", '', $string);
}

echo extract_numbers('$100');

?>


Output:
1
100


Create a new paste based on this one


Comments:
posted by dawen99@yahoo.com on Dec 6
$11221
reply
posted by dawen99@yahoo.com on Dec 6
K123
reply