Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

String manipulation

Hi,

I would like to transform a string into a dashed url in lower case, e.g.

L'évènement Xyz

should be

l-evenement-xyz

(note that I need to get rid of the accents, like é, è, ë, ê, ô, ö, ù, û, ü , î, ï, à, â, ä
also quotes may appear like the example above, but also !, ?, :,  etc. )

Thank you for any help.
0
matthew_be
Asked:
matthew_be
1 Solution
 
niko86Commented:
you could use strtr to translate characters
eg:
$yournewstring = strtr($yourstring, "()!$'?: ,&+-/.`R}aS~x¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ",
     "--------------SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");

Open in new window

0
 
matthew_beAuthor Commented:
Experts Exchange have some problem with the encoding,
e.g. in your code you replace 'a' by 's',
but I know Experts Exchange replaces some characters.


Thank you !
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now