PHP Classes

File: translated.php

Recommend this page to a friend!
  Classes of adriano ghezzi   PHP Yandex Translate API Wrapper   translated.php   Download  
File: translated.php
Role: Example script
Content type: text/plain
Description: translate example
Class: PHP Yandex Translate API Wrapper
Translate text between languages using Yandex API
Author: By
Last change:
Date: 6 years ago
Size: 297 bytes
 

Contents

Class file image Download
<?php
require_once "../apiYandex.php";
$source=$_POST['source'];
$dest=$_POST['dest'];
$text=$_POST['text'];
$yandex=\yandex\apiYandex::Factory();
$translatedText=null;
$msg=null;
$result=$yandex->plainTranslate($text,$source,$dest,$translatedText,$msg);

require_once
"translated.html";