hairynuggets
hairynuggets

Reputation: 3311

How to revert special characters when echoing session? PHP

I have a created a session containing the following data:

Calle San Andrés

When I echo back the session the user sees:

Calle San Andrés

In php, how can I convert the echoed code so that it is once again legible by the user?

Upvotes: 0

Views: 669

Answers (2)

Shiplu Mokaddim
Shiplu Mokaddim

Reputation: 57690

use utf8_encode function. Also make sure your Content-Type header has charset=utf-8.

Upvotes: 1

Simon
Simon

Reputation: 3539

This looks like a problem with the encoding used by the client's browser. Probably, you'll just have to set the encoding to UTF8.

Upvotes: 1

Related Questions