在下面的代码中,我尝试使用
并且。
$code = (string)$code;
将数字转换为字符串,但没有成功。在PHP中如何将数字转换为字符串?$code = 087326487326;
$strlen = strlen($code);
print $strlen."<br/>";
for ($i = $strlen; $i >= 0; $i--) {
print substr($code, 0, $i)."<br/>";
}
输出:
1
0
并且。
$code = '087326487326';
$strlen = strlen($code);
print $strlen."<br/>";
for ($i = $strlen; $i >= 0; $i--) {
print substr($code, 0, $i)."<br/>";
}
输出:
12
087326487326
08732648732
0873264873
087326487
08732648
0873264
087326
08732
0873
087
08
0