NaN
NaN

Reputation: 9094

How to catch accents in the URL?

My users type URL's like:

www.mydomain.com/library/search/animals/içara

But when it gets to the PHP script, it becomes içara.

Is there any way I can fix it before using this data?

Upvotes: 1

Views: 56

Answers (1)

Jimbo
Jimbo

Reputation: 26554

It depends on how you're getting this text. However, let's say you retrieve the text and place it within a variable called $url, using a variable from $_SERVER.

You could try htmlentities:

echo htmlentities($url, ENT_QUOTES, 'UTF-8');

Upvotes: 3

Related Questions