Archive:PHP and MySQL Programming/XML and PHP: Difference between revisions

wikademia>Darklama
m recat sort
No edit summary
Line 149: Line 149:
  </head>
  </head>
  <body>
  <body>
  <h2>Google Articles</h2>
  &lt;h2>Google Articles&lt;/h2>
  <dl>
  &lt;dl>
  <?php  
  <?php  
   
   
Line 172: Line 172:
         global $insideitem, $tag, $title, $description, $link;
         global $insideitem, $tag, $title, $description, $link;
         if ($name == "ITEM") {
         if ($name == "ITEM") {
                 printf("<dt><b><a href='%s'>%s</a></b></dt>",
                 printf("&lt;dt>&lt;b><a href='%s'>%s</a>&lt;/b>&lt;/dt>",
                 trim($link),trim($title));
                 trim($link),trim($title));
                 printf("<dd>%s</dd>", trim($description));
                 printf("&lt;dd>%s&lt;/dd>", trim($description));
                 $title = "";
                 $title = "";
                 $description = "";
                 $description = "";
Line 214: Line 214:
  xml_parser_free($xml_parser);
  xml_parser_free($xml_parser);
  ?>
  ?>
  </dl>
  &lt;/dl>
  </body>
  </body>
  </html>
  </html>