PHP Classes

File: example/clock.php

Recommend this page to a friend!
  Classes of Tomas Pavlatka   PTX PHP GD Analog Clock   example/clock.php   Download  
File: example/clock.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PTX PHP GD Analog Clock
Render the time on analog clock as an image
Author: By
Last change:
Date: 9 years ago
Size: 374 bytes
 

Contents

Class file image Download
<?php

require_once '../vendor/autoload.php';

try {
   
$time = isset($_GET['time']) ? $_GET['time'] : null;

   
$params = array(
       
'canvas' => array(
           
'font' => '../fonts/instruction/instruction.ttf'));
   
$clock = new PTX\Clock($time);
   
$clock->draw($params);
   
$clock->to_browser();
} catch(\
PTX\ClockException $e) {
    echo
$e->getMessage();
}