Jump to content

drizac

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

drizac's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much That did it.
  2. Hello I thought I had it all figured out, but apparently not. I want to write content from an RSS feed into an HTML table. I dont want all of it in one big pile, so I tried using some tricks and regular expressions. This is a snippet from the feed: <?xml version="1.0" encoding="utf-8" ?> - <root> - <products> - <product> <categoryPath>Stuff</categoryPath> <productName>product_name_01</productName> <productCode>22-356-12/756</productCode> <eanNumber /> <manufactorSku /> <price>9999.00</price> <deliveryCost>0.00</deliveryCost> <deliveryTime>5 - 10 days</deliveryTime> <availability>In Stock</availability> <url>http://home.com/boats/fuel.aspx</url> </product> ... </products> - </root> This is my code: $html = file_get_contents('http://home.com/feed/feedfile.aspx'); preg_match_all('/<product>.+<\/product>/', $html , $strng); // Reg_ex echo "<table border=\"1\"> <tr><th>Link</th></tr>"; foreach($strng as $url) { echo "<tr><td>"; echo $url; print_r($url); echo "</td></tr>"; } I am getting this result: Link Title ArrayArray ( ) Can anyone help me identify what am I doing wrong and help me in the right direction.
  3. Thanks a lot, that really helped Is there a point award system somewhere?
  4. Hi First time poster, long time reader. Background: I want to extract different URLs from websites by using get_content() + regex. The amount of URLs differ from website to website. Status Quo: I have the result in a variable. But when I use print_r I get the result as an array inside another array, this is my code: $html = file_get_contents($html); preg_match_all('/'http:\/\/website.com\/.+#1/', $html , $strng); print_r ($strng); Result: Array ( [0] => Array ( [0] => 'http://website.com/first#1 [1] => 'http://slideshop.com/website-second#1 ) ) Question: How can i print the result as a list when the array is inside another array? Thank you in advance D
×
×
  • 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.