PHP Classes

File: testSmileys.php

Recommend this page to a friend!
  Classes of L   Smileys   testSmileys.php   Download  
File: testSmileys.php
Role: Example script
Content type: text/plain
Description: example script
Class: Smileys
This class replaces smiley tags with smiley images
Author: By
Last change:
Date: 22 years ago
Size: 422 bytes
 

Contents

Class file image Download
<html>
<body>
<?php

require "Smileys.php";

$class = new Smileys("smileys.txt");

$smileys = $class->getSmileys();

echo
$class->insertSmileys("A Doom trooper: :trooper:<p>\n");
echo
"<table border=1>\n\t";
for(
$i = 0; $i < sizeof($smileys); $i++) {
    echo
"<tr>\n\t\t<td>" . $smileys[$i][0] . "</td><td><img src=\"" . $smileys[$i][1] . "\"></td>\n\t</tr>";
}
echo
"</table>\n";

?>
</body>
</html>