Re: Script feedback: insert string into another string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/28/07, Micky Hulse <micky@xxxxxxxxxxxxx> 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,
Micky


I 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux