fork download
  1. <?php
  2. $array = json_decode('[{"codServicio":"27","totalTasacion":"4613210"},{"codServicio":"26","totalTasacion":"4618404"},{"codServicio":"25","totalTasacion":"3075470"},{"codServicio":"07","totalTasacion":"2926830"},{"codServicio":"24","totalTasacion":"3078933"}]');
  3. $valor;
  4. foreach($array as $a){
  5. if($a->codServicio === "24"){
  6. $valor = 'entro 24';
  7. break;
  8. }
  9. if($a->codServicio === "01" || $a->codServicio === '1'){
  10. $valor = 'entro en 1';
  11. break;
  12. }
  13. }
  14. echo $valor;
  15. ?>
  16.  
Success #stdin #stdout 0.03s 25920KB
stdin
Standard input is empty
stdout
entro 24