programming-examples/php/String/PHP script to replace the first 'the' of the following string with 'That'..php

4 lines
117 B
PHP
Raw Normal View History

2019-11-15 12:59:38 +01:00
<?php
$str = 'the quick brown fox jumps over the lazy dog.';
echo preg_replace('/the/', 'That', $str, 1)."\n";
?>