File: index.php

Recommend this page to a friend!
  Classes of Peter Schmalfeldt  >  Translate  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example. Make sure your HTML has content-type utf-8 encoding.
Class: Translate
Translate text using the Google AJAX API
Author: By
Last change: Removed unneeded comments
Date: 11 years ago
Size: 464 bytes
 

 

Contents

Class file image Download
<?PHP

include_once('class_Translate.php');
$tl = new Translate("Let's translate this from English to Italian.", "en", "it");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Translate</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
    <?=$tl->translatedText;?>
</body>
</html>


For more information send a message to info at phpclasses dot org.