Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/04/2011, 06:03
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Expresiones regulares

Que tal markmb,

No deberías utilizar regexp para parsear html, es preferible recaer sobre el parser del DOM, te dejo un ejemplo, con tu html:

Código PHP:
Ver original
  1. $html =  '<tr>
  2.            <td>3</td>
  3.             <td>11
  4.             <td>13</td>
  5.             <td>15</td>
  6.          </tr>';
  7.  
  8. $dom = DOMDocument::loadHTML($html);
  9. foreach($dom->getElementsByTagName('td') as $td) {
  10.     echo trim($td->nodeValue) . PHP_EOL;
  11. }

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)