- 1 regular expression performed, instead of 2 in the best case, and 6 in the worst case.
- A simple
switch()construct instead of a chain of
if/elseifs with regexes
- Optimized the order of the switch cases by sorting them by how likely they are to come up
imgtag, instead of having to
I found that to be a fabulous idea, so after downloading Xcode Tools to compile GD to test it out, I implemented that change in my new version of the script. So:
Terror.php, Include Version
- To be included using a PHP
- Runs on a server with only a PHP installation
- May be slightly faster
- To be referenced from an HTML
- Runs on a server with PHP and the GD image library installed
- Much easier to reference, especially from outside
- Download the script of your choice
- Upload it to the desired location on your PHP-compatible server. Remember, the Image Version requires the GD library installed on your server
- In the same directory, upload PNG format images:
- (Image Version only) error.png
<?php include("terror.php"); ?>
As the comments in the scripts say, if you use the script on your site, please email me and let me know; my email address is in the comments.
In the near future, I may be posting a few image sets for use with these scripts, since I see that Mivox is a fan of the (incomplete) Dragon Tales set.