Monday, 15 September 2014

PHP DOM preserve Html structure -



PHP DOM preserve Html structure -

i have code

$strhtml = file_get_contents('05001400300320100033100.html'); $dochtml = new domdocument(); $dochtml->loadhtml($strhtml); $elm = $dochtml->getelementbyid('uppanelactuciones'); $tag = $elm->tagname; $cnt = $elm->nodevalue; echo $tag. ' - '. $cnt;

so.. im getting this:

detalle del registro datos del proceso información radicación del proceso despacho ponente 003 juzgado municipal - civil juez tercero civil municipal clasificación del proceso tipo clase recurso ubicación del expediente de ejecución ejecutivo singular sin tipo de recurso archivo contenido de radicación demandante(s) demandado(s)  3354216 - horacio de jesus jimenez arango  70128088 - rafael angel hernandez orozco contenido actuaciones del proceso fecha de actuación actuación anotación fecha inicia término fecha finaliza término fecha de registro 18 nov 2011 archivo definitivo caja 267 18 nov 2011 27 sep 2010 recepciÓn memorial oj f2 27 sep 2010 21 sep 2010 recepciÓn memorial oj f1 21 sep 2010 10 may 2010 retiro demanda - art.88 pedro nel ospina 10 may 2010 03 may 2010 fijacion estado actuaciÓn registrada el 03/05/2010 las 11:32:40. 05 may 2010 05 may 2010 03 may 2010 03 may 2010 auto rechaza demanda t.4 03 may 2010 07 apr 2010 radicaciÓn de proceso actuaciÓn de radicaciÓn de proceso realizada el 07/04/2010 las 17:54:12 07 apr 2010 07 apr 2010 07 apr 2010

just plain text.

so, question is: there way preserve html estructure, mean td , tr within "uppanelactuciones" or other tag or attribute want?

thanks in advance help! .

that's because nodevalue property text contents of node.

use savexml() method instead:

$elm = $dochtml->getelementbyid('uppanelactuciones'); print $dochtml->savexml($elm);

php dom

No comments:

Post a Comment