Login   Register  
PHP Classes
elePHPant
Icontem

File: example3.2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Daniel Chaves  >  IS Layout  >  example3.2.php  >  Download  
File: example3.2.php
Role: Example script
Content type: text/plain
Description: Example 3.2
Class: IS Layout
Template engine that replaces place holder values
Author: By
Last change:
Date: 2004-03-02 02:59
Size: 866 bytes
 

Contents

Class file image Download
<?php
require_once "../islayout.php";

// The HTML file
$html=<<<END
<html>
<body>

<p align="center">&nbsp;</p>
<p align="center"><b>Today</b>: [date,today,month]/[date,today,day]/[date,today,year]</p>
<p align="center"><b>Yesterday</b>: [date,yesterday,month]/[date,yesterday,day]/[date,yesterday,year]</p>

</body>
</html>
END;

$date['today']['month']=date("m");
$date['today']['day']=date("d");
$date['today']['year']=date("Y");

$unixyesterday=date("U")-60*60*24;
$arrayYesterday=getdate($unixyesterday);

$date['yesterday']['month']=$arrayYesterday['mon'];
$date['yesterday']['day']=$arrayYesterday['mday'];
$date['yesterday']['year']=$arrayYesterday['year'];


$lay=new IS_Layout($html);

// First Argument in replace function are ever the reference of variable in HTMl file
$lay->replace('date',$date);

$lay->display();
?>