programming-examples/php/String/PHP script to replace the first 'the' of the following string with 'That'..php
2019-11-15 12:59:38 +01:00

4 lines
117 B
PHP

<?php
$str = 'the quick brown fox jumps over the lazy dog.';
echo preg_replace('/the/', 'That', $str, 1)."\n";
?>