- vsprintf: documentation ( source)
<?php
echo vsprintf(
"UPDATE %s SET %1$s=REPLACE(%1$s, %s, %s) WHERE %1$s LIKE %s",
array('table',
'field_name',
'^from^',
'^to^',
'^from^')
);