我想在php中每隔一段时间使用substr()我的字符串.. 问题是它只包含1个字符串并停止.. 代码:
function RoundN(X: double): double;
const
cFuncName = 'RoundN';
begin
Result := Trunc(X + Frac(X));
end;
答案 0 :(得分:0)
$string = "This is a test";
while(true)
{
$string = substr($string,0,-1);
if ($string == "")
{
$string = "This is a test";
}
echo $string;
sleep(1);
}