- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
var_dump(preg_match_all("~%(?:(\d+)[$])?[-+]?(?:[ 0]|['].)?(?:[-]?\d+)?(?:[.]\d+)?[%bcdeEufFgGosxX]~", 'The %2$s contains %1$d monkeys', $arguments));
var_dump($arguments);