Minapoli
Minapoli

Reputation: 109

HTML Characters in MySQL PHP

In my database i have the following information

one for each row.

s=evil+dead&Search.x=0&Search.y=0
s=algoritmos&Search.x=20&Search.y=19
s=clavez+para+pc+optimizer+pro&Search.x=-1028&Search.y=-5
s=pc+optimizer+pro
s=fairy+tail&Search.x=30&Search.y=24
s=optimizer+pro&Search.x=14&Search.y=13
s=linares
s=optimicer+pro&Search.x=0&Search.y=0
s=optimizer+pro
s=optimizer+pro&Search.x=-1071&Search.y=-5
s=Escribe+un+pseudoc%C3%B3digo+que+reciba+2+del+usuario%3A&Search.x=-1071&Search.y=-5

When i print them on php looks like

Escribe+un+pseudoc%C3%B3digo+que+reciba+2+argumentos+de+parte+del+usuario%3A

So i need to replace characters like those

%C3%B3 for o
+ for a space

Is there a way to do it via php and not to use an array of strings with each code?

Upvotes: 0

Views: 39

Answers (2)

AmbrosiaDevelopments
AmbrosiaDevelopments

Reputation: 2592

Demo.

<?php

echo urldecode("Escribe+un+pseudoc%C3%B3digo+que+reciba+2+argumentos+de+parte+del+usuario%3A");

?>

Upvotes: 0

raidenace
raidenace

Reputation: 12834

I think urldecode should do it for you.

Upvotes: 2

Related Questions