Hi All
i have the following string :
$sortable='record_69#record_83#record_70##'
how i can get all numbers(id) from that $sortable string?
i try to do somthing like this:
preg_match_all('[0-9]', $sortable, $result, PREG_PATTERN_ORDER);
print_r($result);
but the result is Array ( [0] => Array ( ) )
i wnat $result to be like $result[0]=69……
Thank you
The pattern
[0-9]takes only one number. You want to select more than one, so you have to use a quantifier :You also need to add delimiters (/ in this case), and parenthesis to capture the numbers.