PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Filippo Toso   Key Highlighter   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Standard sample file
Class: Key Highlighter
Highlight keywords in current script output
Author: By
Last change:
Date: 19 years ago
Size: 273 bytes
 

Contents

Class file image Download
<?php
require ('keyhighlighter.class.php');

function
my_highlighter ($matches) {
    return
'<span style="font-weight: bolder; color: #FF0000;">' . $matches[0] . '</span>';
}

new
keyhighlighter ('W3C', false, 'my_highlighter');
readfile ('http://www.w3c.org/');
?>