preg_replace or ereg_replace.. or something
| From: | Nicola Delbono | Date: | Sat, 11 May 2002 17:13:34 +0000 |
| Subject: | preg_replace or ereg_replace.. or something | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13710@lists.php.net to get a copy of this message | ||
Hello I'd like to have a regex which can find words > 4 length
in the body of an HTML page adding an incrementing number before
every word, but preserving original HTML ( so no strip_tags )
Example:
<html><head><title></title></head>
<body>
<h1>Hello,</h1> this is my first brilliant page<br>
on the web. Hey <b>what</b> an <i>amazing</i> thing.
</body>
</html>
would become
<html><head><title></title></head>
<body>
<h1>[1]Hello,</h1> [2]this is my [3]first [4]brilliant [5]page<br>
on the web. Hey <b>[6]what</b> an <i>[7]amazing</i> [8]thing.
</body>
</html>
I'm getting crazy with escapes and tags..
Thanks
Nicola Delbono
///////////////////////////////////////////
Il notiziario dei notiziari
http://www.notiziarioweb.it/
///////////////////////////////////////////
www.smscitta.com | www.musicalbox.it
www.filosofo.it | www.bollicine.com