Ver Mensaje Individual
  #7 (permalink)  
Antiguo 11/09/2014, 19:58
rodrigo_temuco
 
Fecha de Ingreso: abril-2011
Ubicación: Vilcún, cerca de Temuco
Mensajes: 67
Antigüedad: 13 años
Puntos: 5
Respuesta: como hacer un str_replace al crear un PDF

¿pusiste los valores de $find y $repl?
Código PHP:
Ver original
  1. function Row($data)
  2. {
  3.     $find = array('Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ','ü', 'á', 'é', 'í', 'ó', 'ú', 'ñ','ü','"');
  4.     $repl = array('a', 'e', 'i', 'o', 'u', 'n', 'u', 'á', 'é', 'í', 'ó', 'ú', 'ñ', 'u','');
  5.  
  6.     $this->SetX($this->TableX);
  7.     $ci=$this->ColorIndex;
  8.     $fill=!empty($this->RowColors[$ci]);
  9.     if($fill)
  10.         $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]);
  11.  
  12.     foreach($this->aCols as $col)
  13.         $txt = str_replace($find, $repl, $data[$col['f']]);
  14.         $this->Cell($col['w'],5,$txt,1,0,$col['a'],$fill);
  15.     $this->Ln();
  16.     $this->ColorIndex=1-$ci;
  17. }