search

Home  >  Q&A  >  body text

! = Isn’t this an inequality symbol? Why multiplication

$sum=1;
     for($i=1;$i<=$name;$i ){
      $sum*=$name[$i];
     echo "{$sname} != {$sum}"; 

提示错误?

whxnwhxn2042 days ago1951

reply all(7)I'll reply

  • 王林

    王林2019-08-15 16:21:37

    ! =If you put it in double quotes, wouldn't it just be a string?

    reply
    0
  • whxn

    whxn2019-05-24 23:26:19

    The cause of the error has been solved and now I understand! = has no specific meaning, just a symbol

    reply
    0
  • 她说

    她说2019-05-24 23:25:07

    The reason for the error is that the braces after the for loop do not match

    reply
    0
  • whxn

    whxn2019-05-24 23:25:03

    That's right

    reply
    0
  • 她说

    她说2019-05-24 23:24:23

    That's not a factorial, it's a statement from echo, so it looks like a factorial after it's output.

    reply
    0
  • 血脉仙境

    血脉仙境2019-05-24 20:52:39

    var_dump()Try

    reply
    0
  • whxn

    I just don’t understand! = This is not equal. Why can it be used for multiplication operations?

    whxn · 2019-05-24 20:55:30
  • Cancelreply