NYCPHP Meetup

NYPHP.org

[nycphp-talk] Top 5 Most Useful PHP Functions? xpath

Jon Baer jonbaer at jonbaer.net
Thu Nov 11 23:43:46 EST 2004


Damn that's handy .. 

Normally takes a few lines and bloated libraries to do the same thing in
other unnamed languages :-)

Thanks.

- Jon

>>> list($version) = simplexml_load_string($xml)->xpath('/foo[@bar =
"baz"]/@version');

The xpath() method returns an array of items, but I know I'm only interested
in the first (and only) one. <<<





More information about the talk mailing list