Re: Script feedback: insert string into another string
| From: | Tijnema ! | Date: | Sat, 28 Apr 2007 11:12:20 +0000 |
| Subject: | Re: Script feedback: insert string into another string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254053@lists.php.net to get a copy of this message | ||
On 4/28/07, Micky Hulse <micky@ambiguism.com> wrote:
Just FYI, I did some slight upgrades/updates to the code... Seems to be working pretty good now. :) <http://www.ambiguism.com/sandbox/insert/insert.php> Thanks again Tijnema! Cheers, MickyI think i found another problem in your script, when i set the word count to 2, with your example test, at some point there is this: (separator = || ) ||Vestibulum urna. <h6>Test ||header</h6> Nam egestas ||rhoncus nisl. This occurs because you count a word starting with < not as a word, but since there's no space between > and Test, Test isn't recognized as a word either. So you should want to use strip_tags on every word, but only on inside the eregi function. So like this: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', $array[$i])) { becomes: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', strip_tags($array[$i]))) { That would fix it :) Tijnema