PHP Classes

File: Fogg/Google/CustomSearch/example.php

Recommend this page to a friend!
  Classes of Jacob Fogg   PHP Google Custom Search API   Fogg/Google/CustomSearch/example.php   Download  
File: Fogg/Google/CustomSearch/example.php
Role: Example script
Content type: text/plain
Description: An example
Class: PHP Google Custom Search API
Search for keywords using Google Custom Search API
Author: By
Last change:
Date: 9 years ago
Size: 328 bytes
 

Contents

Class file image Download
<?php
use Fogg\Google\CustomSearch\CustomSearch;
require
'CustomSearch.php';

//Initialize the search class
$cs = new CustomSearch();

//Perform a simple search
$response = $cs->simpleSearch('whole foods');

//Perform a search with extra parameters
$response2 = $cs->search('whole foods', ['excludeTerms'=>'tomato']);