|
|
PHP ExamplesGetting REST Results with Simple CachingHere is a function with demonstrates how to combine fetching REST results from Amazon's A2S servers with a simple caching scheme using a MySQL database.
function getPage($url, $maxage=7, $cache = true)
{
$body = "";
if ($cache)
... [More] PHP A2S Demo 1 - ItemLookupThe following is a simple example of using PHP to perform an A2S ItemLookup
operation and display the information in HTML. It uses functions usually included
in PHP version 4 and later.
<?... [More] Trimming Descriptions and ReviewsOften you would like to trim a product description or customer review to a shorter length. The following PHP function will trim a string to a desired length. It breaks the string at a space.
function cutString($text, $limit)
{
$text =... [More] Using CURL to Get Results from ECSThe following PHP function allows you to fetch results from an A2S query including the status code. It returns the text returned from the URL. It also returns the HTTP status code and the HTTP headers.
function getAmazonPage($url,... [More] |
|
|
|