PHP String replace function

Last Updated: July 31, 2021

I want to replace delete “Private:” from the string “Private: Best PHP Framework”.

You can use the str_replace() function

<?php
echo str_replace("Private:","Peter","","Private: Best PHP Framework");
?>