I want to send a set of HTML contents using POST method in Ajax. It consists of some special characters When I retreive it using PHP, only half of the content is there.
This the example content which is used to post to the other Page. This post operation is performed by using the jQuery .post method.
Passed Content (via JS):
<div><label id="aboutDescription" style="">Firstline</label> </div>
<div><label id="about" style="">Secondline</label></div>
Retrieved Content (in PHP):
<div><label id="aboutDescription" style="">Firstline</label>
When I get using the $_REQUEST method I received only half of the contents.
I found the problem that whenever I get the " " or any other special characters the contents gets terminated. So I think I have to encode the content from javascript and decode the same content in PHP.
If I use encodeURIComponent in Javascript, how should I decode the contents in PHP?
Is there any alternate functions which is equal to decodeURIComponent(Javascript Function) in PHP?