<?php
"id" => 35,
"nome" => "Parada 35 - Copacabana",
"endereco_completo" => "Rua Copacabana",
"tempo" => 5
),
"id" => 36,
"nome" => "Parada 36 - Copacabana",
"endereco_completo" => "Rua Copacabana",
"tempo" => 11
),
"id" => 37,
"nome" => "Parada 37 - Copacabana",
"endereco_completo" => "Rua Copacabana",
"tempo" => 7
),
"id" => 38,
"nome" => "Parada 38 - Boa Viagem",
"endereco_completo" => "Rua Vinte de Janeiro",
"tempo" => 12
),
"id" => 39,
"nome" => "Parada 39 - Boa Viagem",
"endereco_completo" => "Rua Vinte de Janeiro",
"tempo" => 6
),
"id" => 40,
"nome" => "Parada 40 - Boa Viagem",
"endereco_completo" => "Rua Barão de Souza Leão",
"tempo" => 7
),
"id" => 41,
"nome" => "Parada 41 - Boa Viagem",
"endereco_completo" => "Rua Barão de Souza Leão",
"tempo" => 7
),
"id" => 42,
"nome" => "Parada 42 - Boa Viagem",
"endereco_completo" => "Rua Barão de Souza Leão",
"tempo" => 11
),
"id" => 43,
"nome" => "Parada 43 - Boa Viagem",
"endereco_completo" => "Rua Barão de Souza Leão",
"tempo" => 11
)
);
$indiceParadaInicial = rand(0, count($arrayParadas) - 1);
$tempoTotal = 0;
echo "Começa na " . $arrayParadas[$indiceParadaInicial]["nome"] . PHP_EOL;
for ($i = $indiceParadaInicial; $i < count($arrayParadas); ++$i){ $tempoTotal += $arrayParadas[$i]["tempo"];
}
echo $tempoTotal;
PD9waHAKCiRhcnJheVBhcmFkYXMgPSBBcnJheSgKCUFycmF5KAoJCSJpZCIgPT4gMzUsCgkJIm5vbWUiID0+ICJQYXJhZGEgMzUgLSBDb3BhY2FiYW5hIiwKCQkiZW5kZXJlY29fY29tcGxldG8iID0+ICJSdWEgQ29wYWNhYmFuYSIsCgkJInRlbXBvIiA9PiA1CgkpLAoJQXJyYXkoCgkJImlkIiA9PiAzNiwKCQkibm9tZSIgPT4gIlBhcmFkYSAzNiAtIENvcGFjYWJhbmEiLAoJCSJlbmRlcmVjb19jb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