Monday, February 21, 2011

Re: extracting data within tags

http://php.net/manual/en/simplexml.examples-basic.php

Read this - if you still have problems ask on a general PHP programming list.

Cheers
Tarique


On Tue, Feb 22, 2011 at 8:32 AM, johnlaw <johnnugroho88@gmail.com> wrote:
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



--
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================

--
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: