Monday, February 21, 2011

extracting data within tags

Hi,,

I'm a newbie in php..
I have xml files from which i want to extract it into information
in .txt file...
can anyone show me how to convert this,

<sample1>north</sample1>
<sample2>south</sample2>
<sample3>west</sample3>
<sample4>east</sample4>
<sample5 />
<sample6 />
<sample7>whatever</sample7>

How do i able to convert that into such info below,

sample1:north
sample2:south
sample3:west
sample4:east
sample7:whatever

I would appreciate anyone helping me with this...i learn that somehow
it is possible with str_replace, substr, and strpos...
Thx so much in advance,,

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: