Jump to content

parsing RDF tags


ishelk

Recommended Posts

in my RDF file I have following lines.

<Restaurant r:id="Afghanistan/Kabul/Anaar_Restaurant1046807280">

  <Location>Afghanistan/Kabul</Location>

  <d:Title>Anaar Restaurant</d:Title>

  <Address>House Number 6, Street 4</Address>

  <City>Kabul</City>

  <Country>Afghanistan</Country>

  <Phone>070 284 315, 070 291 857</Phone>

  <CrossStreet>Kolola Pusta behind the UNICA guesthouse</CrossStreet>

  <Hours>daily 11am-3pm, 7pm-11pm</Hours>

  <ParsedHours>11-15,19-23|11-15,19-23|11-15,19-23|11-15,19-23|11-15,19-23|11-15,19-23|11-15,19-23</ParsedHours>

  <FoodRating>6.0</FoodRating>

  <ServiceRating>5.0</ServiceRating>

  <AmbianceRating>7.0</AmbianceRating>

  <OverallRating>6.0</OverallRating>

  <RecommendedDishes>Sesame Chicken (appetizer) Tandoori Lamb Ribs </RecommendedDishes>

  <Cuisine>Indian / Pakistani</Cuisine>

  <Cuisine>Chinese</Cuisine>

  <Cuisine>Thai</Cuisine>

  <Review r:resource="Afghanistan/Kabul/Anaar_Restaurant1046807280|1071492143"/>

  <Review r:resource="Afghanistan/Kabul/Anaar_Restaurant1046807280-1089924370"/>

</Restaurant>

 

Through PHP I need to extract the two resource links. How can I do that using preg_match.

 

I used following but result is only one line.

 

            preg_match('|<Review r:resource="(.*?)"/>|is', $post, $reviews);         

 

Thanks in advance!!

Ish

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.