- str_replace: documentation ( source)
- vprintf: documentation ( source)
<?php
$subs = array('Hello','World','!');
$string = ">>>?<<<%%s>>>?<<<>>>?<<<";
$arr = array('Hello', 'World', '!');
vprintf(str_replace(array('%', '?'), array('%%', '%s'), $string), $subs);