|
Posted by Alvaro G. Vicario on 06/21/06 19:18
*** lazypig06@gmail.com escribió/wrote (21 Jun 2006 11:08:10 -0700):
> --------------------------------------------------------------
> Junk dataflasjfasj
> <firsttag>
> <secondtag>data</secondtag>
> <thirdtag>whatever</thirdtag>
> </firsttag>
>
> junk dataga.
> ---------------------------------------------------------------
>
> Does someone know how to remove the junk in the file and just return
> the actual xml stuff( including the <firsttag> tag ?
$foo=preg_replace('/^.*<firsttag>/mU', '', $foo);
$foo=preg_replace('/<\/firsttag>.*$/mU', '', $foo);
This is just an idea, make sure it works as expected in all special cases.
--
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
--
[Back to original message]
|