function
ajax_encode(
$str
){
$patern
=
array
(
"/%/"
,
"/=/"
,
"/&/"
);
$rp
=
array
(
"%25"
,
"%26"
,
"%3D"
);
return
preg_replace(
$patern
,
$rp
,
$str
);
}
function
ajax_decode(
$str
){
$patern
=
array
(
"/%25/"
,
"/%26/"
,
"/%3D/"
);
$rp
=
array
(
"%"
,
"="
,
"&"
);
return
preg_replace(
$patern
,
$rp
,
$str
);
}