📅  最后修改于: 2022-03-11 14:53:57.383000             🧑  作者: Mango
\n";
/* These two examples replace all of $var with 'bob'. */
echo substr_replace($var, 'bob', 0) . "
\n";
echo substr_replace($var, 'bob', 0, strlen($var)) . "
\n";
/* Insert 'bob' right at the beginning of $var. */
echo substr_replace($var, 'bob', 0, 0) . "
\n";
/* These next two replace 'MNRPQR' in $var with 'bob'. */
echo substr_replace($var, 'bob', 10, -1) . "
\n";
echo substr_replace($var, 'bob', -7, -1) . "
\n";
/* Delete 'MNRPQR' from $var. */
echo substr_replace($var, '', 10, -1) . "
\n";
?>