Solved

String manipulation

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

708 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

16 Experts available now in Live!

Get 1:1 Help Now