converting a web page
| From: | Cybercandy Ltd | Date: | Wed, 14 Feb 2001 20:35:52 +0000 |
| Subject: | converting a web page | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-39737@lists.php.net to get a copy of this message | ||
I've written a little program to carry out a process similar to
that of the dialectizer at http://rinkworks.com/dialect/
it loads
a web page and then runs through the page translating certain
words and phrases I would appreciate any comments or advice on the
the process I've used and whether anyone can think of improvements in
speed and efficiency that I might implement.
The conversion dictionary is stored in a mysql database in two columns
preconv and postconv I load this into a array and then iterate through
the array using the following
while ($row= mysql_fetch_array($sql_result)){
$page = eregi_replace("$row[0]","<b><font
color='#FF0000'>".$row[1]."</b></font>",$page);
}
I've chosen eregi because the case insensivity is important.
Any thoughts or comments?
Allan