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