Get Google Search Results - Php

Search Results

Snippet Code

Rate this page :
  [ 0 votes]

Google api provides a way to embed google search results in our web page. Visit the following link to sign up for an api key and place it in the code to get the search results.

//Name this class as class.googlesearch.php <?php class googlesearch { /*start of returnresults function*/ function returnresults($search,$startv,$key) { $search = trim($search); /* trim whitespace at start and end to ensure no empty query is submitted*/ $search=html_entity_decode($search); if(strlen($search) == 0) { echo "<p>Error: empty search</p>"; } else { $get = file_get_contents("


Ask Questions

Ask Question