Heim  >  Fragen und Antworten  >  Hauptteil

Wie berechnet man per Computerberechnung, dass $cup 13 entspricht?

$cup Die Computerberechnung ergibt 13. Wie berechnet man das?

phpcn_u11218phpcn_u112182619 Tage vor1454

Antworte allen(2)Ich werde antworten

  • MOMO

    MOMO2017-08-17 23:31:08

    <?php


    $x = 5;


    $y = ++$x;

    $z = $x + $y;

    echo "{$z} </br>";

    echo "{$x} </br>";

    echo $y;

    ?>

    //你将$y = ++$x;这段代码得加号改到前面跟改到后面之后。注意观察变化。多琢磨几遍就明白了

    Antwort
    0
  • PHP中文网

    PHP中文网2017-07-24 09:16:17

    <?php
    $x = 5;
    $y = 6;
    $foo = $x++ + $x--; //$x和$y不变
    $bar = ++$y + ++$x; //$x=6 $y=7
    $cup = $x-- + $y--; //$x和$y不变   6+7=13


    Antwort
    0
  • StornierenAntwort