Home > Article > Backend Development > Regarding the solution to the problem that the page script assignment fails due to carriage returns in the string when passing parameters in the url address_PHP Tutorial
When accepting parameters through the url address, the value V of some parameters has a carriage return '%0A'. At this time, when the page script is displayed, paying this value V to the script variable may cause script errors. .
So, correspondingly: URL-encode some strings when passing values at the beginning, and then URL-decode when assigning values in the script, so as to avoid the above problems.
In PHP, the operation functions for URL encoding are: urlencode() and urldecode()
The corresponding URL encoding operation functions in js are: encodeURI() and decodeURI()