";
// Open the article, and read its contents.
$fh = fopen("article.html", "rt");
while (!feof($fh)) {
$article .= fgetss($fh, 1024, $tags);
}
CHAPTER 10 ?– WORKING WITH T HE FILE A ND OPERATING SYSTEM 295
// Close the handle
fclose($fh);
// Open the file up in write mode and output its contents.
$fh = fopen("article.html", "wt");
fwrite($fh, $article);
// Close the handle
fclose($fh);
?>
?– Tip If you want to remove HTML tags from user input submitted via a form, check out the strip_tags()
function, introduced in Chapter 9.
Pages:
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369