PHP String Exercises: Remove part of a string
PHP String: Exercise-20 with Solution
Write a PHP script to remove part of a string.
Original String : 'The quick brown fox jumps over the lazy dog'
Remove 'fox' from the above string.
<?php $my_str = 'The quick brown fox jumps over the lazy dog'; echo str_replace("fox", " ", $my_str)."\n"; ?>
The quick brown jumps over the lazy dog
PHP Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?