||08-14-2009 02:31 PM
Special characters function
Hi, I have this function that takes a title with any random characters in it and generates a friendly url from it:
// Switch none standard letters
$title1 = strtr($title,"ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ","SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
// Remove special chars
$allowed = "/[^a-z0-9\\040\\.\\-\\_]/i";
$title1 = preg_replace($allowed,"",$title1);
// Replace spaced with _
$title1 = preg_replace('/\s/', '_', $title1);
To test it I've then entered in this:
but the resulting friendly url is:
Any ideas where I am going wrong?
||08-14-2009 03:22 PM
There isn't another function to generate characters randomly. Sorry if I didn't make it clear but the Title I pass into this function could be something like:
Facto Delafé y las Flores Azules
and needs the é replacing so the final output should be:
but instead I get:
||08-17-2009 03:00 PM
Anyone with any ideas?
|All times are GMT. The time now is 04:12 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0