regex phones and phones type

Hello,
I have this string from db:
$str = "1:78 78 12345, 2:678 77 1234567899, 1:44 4 123456789";
The first is the type of phone – 1 or 2, after : should phone – 1: 2: 1: 1: . All separated by commas.
How can I split this string so it foreach it.
After each comma should type and next is phone.
Thanks!

See original post by bumbar

Leave a Reply