str_replace is a very simple PHP function. It replaces chosen characters in a string.
$a = "this is a sentence";
$b = str_replace(" ", '_', $a);
The above code will replace all the spaces in the sentence with underscores.
13th February 2020
© 2020 The Web Taylor Hampshire. Ground Floor, 1000 Lakeside North Harbour, Western Road, Portsmouth, Hampshire, PO6 3EZ