Jump to content

Recommended Posts

Hi there...

 

I have the following xml list

 

<publications>
<pub>
	<date>November 2007</date>
	<location>/pubs/nov07.pdf</location>
</pub>

<pub>
	<date>October 2007</date>
	<location>/pubs/oct07.pdf</location>
</pub>

<pub>
	<date>September 2007</date>
	<location>/pubs/sep07.pdf</location>
</pub>

<pub>
	<date>August 2007</date>
	<location>/pubs/aug07.pdf</location>
</pub>

</publications>

 

What I am wanting to do is display only the current month, and the previous month, as a hyperlink on my page. 

 

I have no idea how to use xml in php.  Can someone help me please??

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/80210-solved-displaying-xml-list-in-php-page/
Share on other sites

  • 3 weeks later...

Study this, it'll help

 

$xml = new SimpleXMLElement(file_get_contents("http://services.hotornot.com/rss/girls/"));

foreach($xml->channel->item as $item) {
$picture = $item->title;
$link = $item->link;
$description = $item->description;

print "<div class=\"person\">";

print "<div class=\"picture\">";
print "<a href='".$link."' target=\"new\">".$picture."</a>";
print "</div>";

print "<div class=\"personInfo\">";
print "<p>" . $description . "</p>";
print "</div>";

print "</div>";
}

 

Cheers  ;D

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.