Solved

String manipulation

Posted on 2009-04-11
3
183 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now