Thanks JJ fir this reference: how to parse foaf/rdf file with php.
This article set out to show you how PHP can be used to explore FOAF social networks. Two simple idioms were explored: pattern matching and iteration. Together, these two techniques are at the heart of any application that involves parsing RDF. Hopefully you're now in a position to start exploring the world of FOAF and, by extension, RDF.