$sum=1; for($i=1;$i<=$name;$i ){ $sum*=$name[$i]; echo "{$sname} != {$sum}";
提示错误?
! =If you put it in double quotes, wouldn't it just be a string?
The cause of the error has been solved and now I understand! = has no specific meaning, just a symbol
The reason for the error is that the braces after the for loop do not match
That's right
That's not a factorial, it's a statement from echo, so it looks like a factorial after it's output.
var_dump()Try
! =If you put it in double quotes, wouldn't it just be a string?
The cause of the error has been solved and now I understand! = has no specific meaning, just a symbol
The reason for the error is that the braces after the for loop do not match
That's right
That's not a factorial, it's a statement from echo, so it looks like a factorial after it's output.
var_dump()Try