日期:2014-05-16 浏览次数:20438 次
Here you can see how the various JavaScript and PHP functions apply to a range of common characters.
| Input | JavaScript | PHP | ||||
| escape | encodeURI | encodeURIComponent | urlencode | rawurlencode | htmlentities | |
|---|---|---|---|---|---|---|
| <space> | %20 | %20 | %20 | + | %20 | |
| ! | %21 | ! | ! | %21 | %21 | ! | 
| @ | @ | @ | %40 | %40 | %40 | @ | 
| # | %23 | # | %23 | %23 | %23 | # | 
| $ | %24 | $ | %24 | %24 | %24 | $ | 
| % | %25 | %25 | %25 | %25 | %25 | % | 
| ^ | %5E | %5E | %5E | %5E | %5E | ^ | 
| & | %26 | & | %26 | %26 | %26 | & | 
| * | * | * | * | %2A | %2A | * | 
| ( | %28 | ( | ( | %28 | %28 | ( | 
| ) | %29 | ) | ) | %29 | %29 | ) | 
| - | - | - | - | - | - | - | 
| _ | _ | _ | _ | _ | _ | _ | 
| = | %3D | = | %3D | %3D | %3D | = | 
| + | + | + | %2B | %2B | %2B | + |