PHP str_repeat 不能仅使用 space 字符
PHP str_repeat don't work with just the space character
这是通过添加一个 space 和一个点来实现的:
echo str_repeat(' .', $max-$i);
但这并没有添加任何东西:
echo str_repeat(' ', $max-$i);
而且我 100% 确定 $max-$i
不是 0,因为只需在 space 之后添加一个点或一个字符,它就会添加 space 和那个字符.
使用一个HTML字符串:
echo str_repeat(' ', $max-$i);
这是通过添加一个 space 和一个点来实现的:
echo str_repeat(' .', $max-$i);
但这并没有添加任何东西:
echo str_repeat(' ', $max-$i);
而且我 100% 确定 $max-$i
不是 0,因为只需在 space 之后添加一个点或一个字符,它就会添加 space 和那个字符.
使用一个HTML字符串:
echo str_repeat(' ', $max-$i);