我想要一个 130 个字符的随机字符串
$param['sec1'] = base64_encode(openssl_random_pseudo_bytes(95));
$param['sec1'] = substr($param['sec1'], 0, 130);
var_dump($param['sec1']);
我得到以下结果:
string(128) "zrAND6xJVREfTA6SMfp1k9C+UDzabPMse6Awd/1Vul+2AgHLBzoOc0T/VlbQSV6dVjy38
d/3dkRDaNnG9tJjCvy3Bm/OccPKo2amJkEANTAWTvt+cPtgIZW42FWdntE=" ["zrAND6xJVREfTA6SMfp1k9C+UDzabPMse6Awd\/1Vul+2AgHLBzoOc0T\/VlbQSV6dVjy38d\/
3dkRDaNnG9tJjCvy3Bm\/OccPKo2amJkEANTAWTvt+cPtgIZW42FWdntE=","dT+w00J2fQPwst2
VKKG55cck6THLW7PIkKQReYlw4U3Q4fWJqagsxfRzrGl0fsHbjWWw9diYkqDbagJLwm0KCUVjHTC
9Rs62Tv1tdyIXNkJtc7Ba4mRbbTOZpHpeHFw=","SAbUFosDFS1KKHXAXGGtfxO09WxeqK\/rO10
9cKKtUPUA7dgn\/jC\/snRZt4Z\/OAlMdL4FU9nq0HxcvXAafKPDV3akLcQReJAvybkjIPTUTPcu
5jo6N1kxFt3tX5GGWp0="]
var_dump 说 128 个字符,但显然超过 128 个 - 为什么会这样?