fork download
  1. <?php
  2.  
  3. // http://es.stackoverflow.com/q/8590/127
  4.  
  5. $Vec_PARTEVBLE[20][0]="f_creacion";
  6. $Vec_PARTEVBLE[20][1]="";
  7. $Vec_PARTEVBLE[20][2]="Fecha Creación";
  8. $Vec_PARTEVBLE[20][3]="0";
  9.  
  10. $Vec_PARTEVBLE[21][0]="d_referencia_prov";
  11. $Vec_PARTEVBLE[21][1]="";
  12. $Vec_PARTEVBLE[21][2]="Referencia Prov.";
  13. $Vec_PARTEVBLE[21][3]="0";
  14.  
  15. $Vec_PARTEVBLE[22][0]="pr_venta_actual";
  16. $Vec_PARTEVBLE[22][1]="";
  17. $Vec_PARTEVBLE[22][2]="Pr. Venta Actual";
  18. $Vec_PARTEVBLE[22][3]="1234";
  19.  
  20.  
  21. foreach ($Vec_PARTEVBLE as &$fila) {
  22. if ($fila[0] == 'pr_venta_actual') {
  23. $fila[3] = number_format($fila[3], 2);
  24. }
  25. }
  26.  
  27. var_dump($Vec_PARTEVBLE);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
array(3) {
  [20]=>
  array(4) {
    [0]=>
    string(10) "f_creacion"
    [1]=>
    string(0) ""
    [2]=>
    string(15) "Fecha Creación"
    [3]=>
    string(1) "0"
  }
  [21]=>
  array(4) {
    [0]=>
    string(17) "d_referencia_prov"
    [1]=>
    string(0) ""
    [2]=>
    string(16) "Referencia Prov."
    [3]=>
    string(1) "0"
  }
  [22]=>
  &array(4) {
    [0]=>
    string(15) "pr_venta_actual"
    [1]=>
    string(0) ""
    [2]=>
    string(16) "Pr. Venta Actual"
    [3]=>
    string(8) "1,234.00"
  }
}