A
A
Alexander2015-04-17 17:05:55
PHP
Alexander, 2015-04-17 17:05:55

How to get urlencode() encoded string via json?

Hello. After receiving the
json response, you need to insert the received variable into the string and make location on this string.
(Cyrillic).

$jsonarr = array('usname' => urlencode($login));
echo json_encode($jsonarr);

window.location.replace("http://site.ru/u/"+data.usname+"/")

Tell me how and where to process the variable in order to insert a variable identical to urlencode (Cyrillic) in php into location?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2015-04-17
@FanatPHP

Native.
This is not a circle of high literature.
A site about programming.
You just have to show it.
The problem here may be only in your program. Insofar as
Just like any other. Of course , there is no difference.

E
Evgeny Petrov, 2015-04-17
@Petroveg

decodeURIComponent() won't save the literary and polite programmer?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question