Minientrada

Convertir CSV a array asociativo de PHP


$array = $fields = array(); $i = 0;
$handle = @fopen("file.csv", "r");
if ($handle) {
while (($row = fgetcsv($handle, 4096)) !== false) {
if (empty($fields)) {
$fields = $row;
continue;
}
foreach ($row as $k=>$value) {
$array[$i][$k] = $value;
}
$i++;
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}

Anuncios
Minientrada

ORACLE Medir Tiempos

SET SERVEROUTPUT ON
DECLARE
v_d1 TIMESTAMP ;
v_d2 TIMESTAMP ;
v_n INTERVAL DAY TO SECOND ;
v_variable NUMBER;
BEGIN
v_d1 := SYSTIMESTAMP ;
SELECT count(*) into v_variable from TABLE;
v_d2 := SYSTIMESTAMP ;
v_n := v_d2-v_d1 ;
DBMS_OUTPUT.PUT_LINE( 'Tiempo transcurrido : ' ||EXTRACT( SECOND FROM v_n )|| ' segundos' ) ;
END;