PHP str_repeat不仅适用于空格字符

问题描述 投票:-1回答:1

这是通过添加空格和点来实现的:

echo str_repeat(' .', $max-$i);

但这并没有增加任何东西:

echo str_repeat(' ', $max-$i);

而且我100%确定$max-$i不是0,因为只需在该空格后添加一个点或一个字符,它就会添加空格和那个字符。

php string echo repeat
1个回答
3
投票

使用HTML字符串:

echo str_repeat(' ', $max-$i);
© www.soinside.com 2019 - 2024. All rights reserved.