fork download
  1. <?php
  2.  
  3. $resultado = [
  4. ["lat" => 0.0,"lon" => 0.0,"horario" => "00:00",],
  5. ["lat" => 0.0,"lon" => 0.0,"horario" => "06:00",],
  6. ["lat" => 0.0,"lon" => 0.0,"horario" => "12:00",],
  7. ["lat" => 0.0,"lon" => 0.0,"horario" => "18:00",],
  8. ["lat" => 0.0,"lon" => 0.0,"horario" => "24:00",]];
  9.  
  10. $result = [];
  11.  
  12. foreach($resultado as $row)
  13. {
  14. $result[] = [
  15. "latitude" => $row["lat"],
  16. "longitude" => $row["lon"],
  17. "conteudo" => $row["horario"]
  18. ];
  19. }
  20.  
  21. var_export( $result );
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
array (
  0 => 
  array (
    'latitude' => 0.0,
    'longitude' => 0.0,
    'conteudo' => '00:00',
  ),
  1 => 
  array (
    'latitude' => 0.0,
    'longitude' => 0.0,
    'conteudo' => '06:00',
  ),
  2 => 
  array (
    'latitude' => 0.0,
    'longitude' => 0.0,
    'conteudo' => '12:00',
  ),
  3 => 
  array (
    'latitude' => 0.0,
    'longitude' => 0.0,
    'conteudo' => '18:00',
  ),
  4 => 
  array (
    'latitude' => 0.0,
    'longitude' => 0.0,
    'conteudo' => '24:00',
  ),
)