Got bored and made a function that handles filling strings similar to mysqli bind_param. It actually gets used a lot in my code. Figured someone else might find it useful.
Example usage:
Using question marks as place holders
$str = 'Hello, my daniweb user name is ? and my real name is ?';
echo fill( $str,'kkeith29','Kyle Keith' );
Using named place holders
$str = 'Hello, my daniweb user name is :user-name and my real name is :real-name';
echo fill( $str,array('user-name'=>'kkeith29','real-name'=>'Kyle Keith') );
Mixing question mark and named place holders
$str = 'Hello, my daniweb user name is ? and my real name is :real-name';
echo fill( $str,'kkeith29',array('real-name'=>'Kyle Keith') );
Escaping place holders - Just put a \ in front
$str = 'Hello, my daniweb user name is \? and my real name is \:real-name';
echo fill( $str,'kkeith29',array('real-name'=>'Kyle Keith') ); //won't replace anything.