fork download
  1. <?php
  2. $array["historico"][] = [
  3. "valor1" => 10,
  4. "valor2" => 15,
  5. "operador" => "*",
  6. "resultado" => 150
  7. ];
  8.  
  9. $array["historico"][] = [
  10. "valor1" => 50,
  11. "valor2" => 5,
  12. "operador" => "-",
  13. "resultado" => 45
  14. ];
  15.  
  16. foreach( $array["historico"] as $key => $value ){
  17. echo "{$value["valor1"]} {$value["operador"]} {$value["valor2"]} = {$value["resultado"]}\n";
  18. }
  19.  
  20.  
Success #stdin #stdout 0.04s 23552KB
stdin
Standard input is empty
stdout
10 * 15 = 150
50 - 5 = 45