If you want to see the last cache of a webpage indexed by Google, you can make a search on Google with this string:
Or, directly in the address bar of your browser, access this url:
- "the_page_address" - is the URL of the page, without http:// .

The example bellow contains a function ( googleCache() ) that returns an array with 2 elements:
  - "pg_cache" - contains the HTML code of the page in cache (without the additional code added by Google).
  - "dt_cache" - the date and time of last cache.
Also, you can separate the <head> and <body> of the page added in cache. For more details, see the comments in code.
/* $pg is the URL address of your page (without http://)
 returns an array with 2 elements:
 - 'dt_cache' = date and time of last cache
 - 'pg_cache' = HTML code of the page in cache
function googleCache($pg) {
 // get datetime of last google cache ( https://coursesweb.net/ )
  $re = array('dt_cache'=>'', 'pg_cache'=>'');
  // gets the page from Google
  $page = file_get_contents('http://webcache.googleusercontent.com/search?q=cache:'.$pg);

  // extract the date/time of the cache
  if(preg_match('/snapshot of the page as it appeared on ([a-z0-9 :]+) GMT/i', $page, $mdc)) {
    $re['dt_cache'] = 'Date-time of the last cache: '. $mdc[1];

  // extract the HTML code of the page in cache
  if(preg_match('#\<div style="position:relative"\>([\s\S]+)#i', $page, $mpc)) {
    $re['pg_cache'] = $mpc[1];

  return $re;

// Test
$pg = 'coursesweb.net/html/';      // URL address of page (without http://)
$g_cache = googleCache($pg);          // get the array with 'dt_cache' and 'pg_cache'
echo $g_cache['dt_cache'];

// if you want to output the page
//  echo $g_cache['pg_cache'];

/* the following instructions store in:
 $head_cache - the HTML <head> of the page in cache
 $body_cache - the HTML code added in the <body> of the page in cache
if(preg_match('#\<head\>([\s\S]+)\</head\>#i', $g_cache['pg_cache'], $mh)) $head_cache = $mh[1];
if(preg_match('#\<body([^\>]*)\>([\s\S]+)\</body\>#i', $g_cache['pg_cache'], $mb)) $body_cache = $mb[2];

Daily Test with Code Example

Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
Last Google Cache of Web Page

Last accessed pages

  1. Contact page - CoursesWeb (10968)
  2. Tabs effect with CSS (11675)
  3. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (17574)
  4. PhpSpreadsheet - Read, Write Excel and LibreOffice Calc files (15674)
  5. SHA512 Encrypt hash in JavaScript (12625)

Popular pages this month

  1. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (1975)
  2. Contact page - CoursesWeb (1923)
  3. Tabs effect with CSS (1923)
  4. Insert, Select and Update NULL value in MySQL (1228)
  5. PHP getElementById and getElementsByTagName (722)