Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Kostas Theodorou  >  Inner Link Replacer  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Inner Link Replacer
Replace text in HTML with links to glossary pages
Author: By
Last change:
Date: 6 years ago
Size: 548 bytes
 

Contents

Class file image Download
<?
include_once("innerlink_replacer.php");

$glossaryItems=array();
$glossaryItems[]=array(
    
'phrase'=>'php',
    
'explanation'=>'PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.'
);
$glossaryItems[]=array(
    
'phrase'=>'Click here',
    
'explanation'=>'Php: the official website',
    
'link'=>'http://www.php.net',
);

$a=new InnerLinkReplacer();
$html='<div>What is php? Click here...</div>';
$html=$a->replaceContext($html,$glossaryItems);
echo 
$html;
?>