Jump to content

Exclude some text from results


chooseodie

Recommended Posts

<?php

$excluded = array(" pee ", " poo ");

$string = "my mum likes to poo whilst she has a pee and also often is peeing";
$replace = " !#@? ";

foreach($excluded as $word) {
$string = str_replace($word, $replace, $string);
}

echo $string;

?>

 

Works fine for me that way?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.