Possibly OT, but think this group may have the solution...
Given a variable of $prodname = "Jane and the Dragon : Fair Weather
Friends";
And the operation code:
$killarray = array('and', '&', 'the', 'of', '-', ':', '.', '?',
'\'', '!', '(', ')');
$linkname = str_replace(' ', '_', str_replace($killarray,"
",makeutf8($prodname))); // Removes all surplus non-essential pieces, and
inserts http-safe spacers
while(strpos($linkname,'__') !== FALSE) {
$linkname = str_replace('__', '_', $linkname); //
Remove multiple 'spacers'
}
I get a result of $linkname = "Jane_Dragon_Fair_Wear_Friends"
As you can see, it's stealing the "the" out of "Weather" and making it
"Wear"...
If I include spaces in the $killarray items, the whole thing turns even
worse, with virtually no _ separators...
I have tried having 'the ' and ' the' (ditto for other words in the
$killarray too) but then it still does the same thing with words such as
'anders', 'sand', 'offer', 'theory' and 'menthe'...
Can anyone please assist me, as this is causing me to go prematurely
bald! -lol-
Perhaps some craftily-crafted Regex would solve it, but that's way
beyond me...
Cheers...
---
Karl
www.KIWIreviews.co.nz ... Where Your Views Count
Please consider the environment before printing this email
For regular updates and advance notice of special events and review goods, why
not join us on
Facebook : http://www.KIWIreviews.co.nz/facebook
or
Twitter : http://www.KIWIreviews.co.nz/twitter
KIWIreviews accepts no responsibility for changes to this email, or for any
attachments, after its transmission from the KIWIreviews server. Thank you.
- - - - - - - - - -
We use CourierPost for all of our freight delivery requirements.
- - - - - - - - - -
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]