Solved

String manipulation

Posted on 2009-04-11
3
189 Views
Last Modified: 2012-05-06
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
Comment
Question by:matthew_be
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

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

Open in new window

0
 

Author Comment

by:matthew_be
ID: 24123598
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question