Noah van der Aa Noah van der Aa - 15 days ago 5
PHP Question

PHP Replace text in string

i have a problem.
I want in php to replace all 'blablabla' with 'bla'(because i hate blablabla). Here's my code:

<?php
$string = 'Dracula always says BlaBlaBla but says he never says BlaBlaBla';
$result = answer to replace here
?>


Thanks

Answer

Use srt_replace function to do that like this :

str_replace("BlaBlaBla","bla",$string);
Comments