PHP Classes

File: example.list.php

Recommend this page to a friend!
  Classes of Dave Smith   USDA PHP Nutritional Products Database Wrapper   example.list.php   Download  
File: example.list.php
Role: Example script
Content type: text/plain
Description: Example Usage
Class: USDA PHP Nutritional Products Database Wrapper
Retrieve nutritional data from USDA database
Author: By
Last change:
Date: 8 years ago
Size: 436 bytes
 

Contents

Class file image Download
<?php
/*
request and display data lists
USDA Nutritional Database Wrapper ver 0.1
*/
include('ndbwrap.class.php');

$ndb = new ndbwrap();

$list = $ndb->getList('g',0);

echo
'<h4>NDB List of Food Groups</h4>';

foreach(
$list->list->item as $item ){
   
    echo
'['.$item->id.'] '.$item->name.'<br>';
   
}

echo
'<hr>';

echo
'database version '.$list->list->sr.'<br>';

echo
$ndb->USDAcitation.'<br>';
?>