Ale*_*lex 2 php string int encode decode
是否有任何PHP函数将字符串编码为int值,稍后我可以将其解码回没有任何键的字符串?
pr1*_*001 5
当然,您可以将字符串转换为数字,反之亦然.考虑:
$a = "" + 1 gettype($a) // integer $b = "$a" gettype($b) // string
您也可以使用settype()进行类型转换.
如果我误解了你并想要编码任意字符串,请考虑使用base64_encode()和bas64_decode().如果要将基本64字符串表示形式转换为基数为10的整数,只需使用base_convert().
归档时间:
15 年,10 月 前
查看次数:
10337 次
最近记录:
12 年,6 月 前