Re: $35 to the first person who can do this XML-parsing PHP script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For something that simple in PHP4, I didn't even bother with the
50-line expat lib solution...

A couple preg matches, or even just strtok and call it done...

//assume file_get_contents is too "new"...
//probably wrong, but be safe
$xml = implode('', file('www.librarytools.com/events/sampledata.txt'));

preg_match_all('|<result i="[0-9+]">.*<f n="eventname">([^<]*)</f>.*(f
n="eventnextoccurrencedate">([^<]*)</f>)?|msiU', $xml, $eventdata);

var_dump($eventdata);

I probably got the regex wrong -- I usually do...

On Thu, March 8, 2007 2:59 pm, Rob Gould wrote:
> Ok, well after fiddling around with PHP samples from the web for a
> few hours, I'm shot.  But I have a project due soon that relies on
> this so I'm willing to pay someone:
>
> I'll send $35 to someone via paypal who can create a PHP script that
> will do the following:
>
> 1)  Read XML data from an URL (www.librarytools.com/events/
> sampledata.txt)
> 2)  Loop through all XML results and print to the screen the
> "eventname" and "eventnextoccurrencedate" (Just the date) values
>
>
> I'll probably kick myself once I see how easy it is, but I'm willing
> to pay to see it working.  Feel free to email me off-list.
>
> - Rob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux