- str_replace: documentation ( source)
- preg_replace: documentation ( source)
<?php
$url = "meno go you to from";
$regexoo = array('to','go');
$text =str_replace($regexoo, '***', $url);
echo $text;
echo "<hr><br>";
$str = "first بل baseball for all";
$pattern = array('/\b(بل|all|first)\b/i',);
$str = preg_replace($pattern, "FOUND", $str);
echo $str;
?>
<p><hr></p>
<?php
$atag ="على ذهب الى من طول فى يشسيشيشي مصطفى حسني where then";
$pattern = array('/\b(then|فى|على|من||طول|where)\b/i',);
$atag = preg_replace($pattern, " ", $atag );
echo $atag ;