<?php $str = 'foobar: 2008'; if (preg_match('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches)) { print_r( array_filter($matches, function ($key) { return !is_int($key); }, ARRAY_FILTER_USE_KEY) ); }
You have javascript disabled. You will not be able to edit any code.