<?php
require_once('../../../includes/load.php');
 $convert_utf8 = function ($s) {
         if (!mb_check_encoding($s, 'UTF-8')) {
             $s = utf8_encode($s);
         }
         return $s;
     };
 $valor=$_REQUEST['valor'];
 $rs= $db->query("SELECT dt.KM_FINAL, dt.id, dt.ID_VEHICULO FROM det_veh dt INNER JOIN vehiculo v ON dt.ID_VEHICULO = '$valor' ORDER BY id DESC LIMIT 1"); 
 $data = array();
 

 while( $rows = mysqli_fetch_assoc($rs) ) {
        $data = array_map($convert_utf8, $rows);     
}
 echo json_encode($data, JSON_UNESCAPED_UNICODE);
?>





 