Oii folks .. If anyone can help me, I need to get values from one date to the other in a txt file. That is, the user sets the start and end date, and the values of those dates are returned. If anyone can help me do that, I'm grateful! bjs
I already have this (relevant part of the code), here I am getting the value that interests me in the file. Dai I would like to get a specific date, and the relative value. I'm putting together a chart with these values. Here's what I need to do: set up another with the date values that the user wants. Sorry if you're badly explained rsrs
One line of the file:
VALID, 920.221, VALID, 920.221, VALID, VALID, 920, 2221, INVALID, 920.221, VALID, 0.0, VALID, 2.4, VALID, -500.0, VALID, -500.0, VALID, -500.0, INVALID - VALUE NOT AVAILABLE, 0.0, VALID, 811,697, VALID, 811,697, VALID, 811,697, INVALID - VALUE NOT AVAILABLE, 0.0, INVALID, 0.0, INVALID, 0.0, INVALID, 0.0, INVALID - VALUE NOT AVAILABLE, 0.0, INVALID, 0.0, INVALID, 0.0, INVALID, 0.0, INVALID - VALUE, 0.0, VALID, 0.0, VALID, 0.0, VALID, VALID, VALUE, 0.0, INVALID - VALUE NOT AVAILABLE, 0.0, INVALID, 360.0, INVALID, 360.0, INVALID, 360.0, INVALID, 0.0, INVALID, 0.0, INVALID, 0.0, INVALID - VALUE NOT AVAILABLE, 0.0, VALID, 34.947,
$arquivo = fopen('graficoItaguacu/arquivo.txt','r');
$dataPoints_umidade = array();
function processaLinha_umidade($linha_umidade){
global $dataPoints_umidade;
list($data, $hora,$tempSt, $tempAvg, $tempSt2, $tempMax, $tempSt3, $tempMin, $umiSt, $umiAvg, $umiSt2, $umiMax, $umiSt3, $umiMin,$pressSt, $pressAvg, $pressSt2, $pressMax, $pressSt3, $pressMin,$precipSt1, $precipPP, $precipSt2, $precipPPMensal,$radLiqSt1, $radLiqAvg, $radLiqSt2, $radLiqMax, $radLiqSt3, $radLiqMin, $radLiqSomaSt, $radLiqSomaSum,$radGl1St1, $radGl1Avg, $radGl1St2, $radGl1Max, $radGl1St3, $radGl1Min, $radGl1SomaSt, $radGl1SomaSum,$radGl2St1, $radGl2Avg, $radGl2St2, $radGl2Max, $radGl2St3, $radGl2Min, $radGl2SomaSt, $radGl2SomaSum,$radDif2St1, $radDif2Avg, $radDif2St2, $radDif2Max, $radDif2St3, $radDif2Min, $radDif2RD3SomaSt, $radDif2RD3SomaSum,$radUVSt1, $radUVAvg, $radUVSt2, $radUVMax, $radUVSt3, $radUVMin, $radUVSomaSt, $radUVSomaSum,$dvSt1, $dvDirAvg, $dvSt2, $dvGusDir, $dvSt3, $dvLullDir, $dvSt4, $dvSpdAvg, $dvSt5, $dvSpdMax, $dvSt6, $dvSpdMin,$chargerSt1, $chargerExter,$intSt1, $intT) = explode(",", $linha_umidade);
array_push($dataPoints_umidade, array("x" => date_timestamp_get(date_create_from_format('m/d/y g:i:s a', "${data} ${hora}"))*1000,"y" => $umiAvg));
}
while ($linha_umidade = fgets($arquivo)) {
processaLinha_umidade($linha_umidade);
}