kennygadams
Programmer
Hello PHP-ers,
I'm trying to get all the Image Numbers from a variable called $string, with all the other characters removed.
The image numbers are always numeric and formatted like 0000-0000-0000-0000.
Here is the code I'm working with...
Any help is greatly appreciated.
Thanks.
Kenny Adams
I'm trying to get all the Image Numbers from a variable called $string, with all the other characters removed.
The image numbers are always numeric and formatted like 0000-0000-0000-0000.
Here is the code I'm working with...
Code:
$string = '[COLOR=red]0001-0611-2520-3615[/color] \t \r123 [COLOR=red]0001-0603-1919-3126[/color] abc >[COLOR=red]0001-0611-2223-1711[/color]</\n';
preg_match_all('/([^\d\d\d\d\-\d\d\d\d\-\d\d\d\d\-\d\d\d\d]+)/i', $string, $matches);
print_r($matches);
Thanks.
Kenny Adams