PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$fp = fopen("SANDLER.DOC", 'r');
$l = fread($fp, 5000);
$patterns = array("/waterboy/","/You can do it!/");
$replacement = "";
$description = preg_replace($patterns, $replacement, $l);
//My goal is to have both techniques working together to filter the contents of SANDLER.DOC
//and echo both sections back as $description.
$patterns[0] = "/lama/";
$replacement[1] = "//";
$description = preg_replace($patterns, $replacement, $l);
echo $description;
Assuming that the sandler.doc contains the words, lama waterboy and the phrase "You can do it!" I need to use these two approaches in combination to replace these words.