Hello,
I have sucessfull followed this tutorial
http://www.phpfreaks.com/tutorial/handling-xml-data
and used xpath to find the books I need, here is my code
Code: [Select]<?php
// load SimpleXML
$books = new SimpleXMLElement('books.xml', null, true);
echo <<<EOF
<table>
<tr>
<th>Title</th>
<th>Author</th>
<th>Publisher</th>
<th>Price at Amazon.com</th>
<th>ISBN</th>
</tr>
EOF;
foreach($books->xpath('book1/book') as $book) // loop through our books
{
echo <<<EOF
<tr>
<td>{$book->title}</td>
<td>{$book->author}</td>
<td>{$book->publisher}</td>
<td>${$book->amazon_price}</td>
<td>{$book['isbn']}</td>
</tr>
EOF;
}
echo '</table>';
?>
now I want to only show the first 5 books in the xml file as it is updated regularly
I can't seem to figure out how to do this.
any help would be great , thanks
void* and sizeof()
Hi,Using void* and sizeof is it possible to get the value of the object ?I understand that dereferencing a void pointer is not directly possible. Is there a way (like casting) or something else to get
Unable to customise toolbar in FCK
<FCKeditorV2:FCKeditor ID="FCKQuesreply" runat="server" ToolbarSet="MyToolbar" BasePath="~/fckeditor/" SkinPath="skins/silver/" CustomConfigurationsPath="~/fckeditor/fckconfig.js"
default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?
Search with relational database
Hey,I have quite a complicated (for me anyway ) relational database for an apartments system I am developing.Keith (kickstart) was very helpful assisting me in creating the relationships and here is
Change Sort Order to Display Newest File First
Hi Guys,I have a page that sorts the contents (PDFs) of a directory and displays them on the webpage chronologically from the oldest (at top) to the newest (at bottom).I'd like to reverse this display
Customizing message/behavior
Hi,I'm using the ASP.NET membership/authorization controls in my application. Some parts of my application are reserved for users who are in certain roles i.e. editor, writer, etc. I control this with
Captcha problem users just refresh and it will let them auto submit again
Users will just re submit and not have to enter the new captcha.. ? Lol but if i refresh the page, the captcha auto makes a new1 so u cant submit.But if u enter captcha code alrdy, then submit form
Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...On first.php I have one input field NAME, and on posting the form it moves to "second.php" showing the entered value of input field using $_POST,
Oracle11g Patch issue
Hi all,I'm getting the following error while installing Oracle11g Patch 11.1.0.7.0 on IBM-AIX/oracle/Disk1/stage/Components/oracle.owb.rsf/11.1.0.7.0/1/Datafiles/filegroup16.jar.when I look into the
Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be gentle with me! Awhile back I wrote out a simple forum to email processor that I used with a few