Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
class Translation
{
const DETECT_YA_URL = 'https://translate.yandex.net/api/v1.5/tr.json/detect';
const TRANSLATE_YA_URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate';
private static $key ="AIza1yCf2zgkmk-nRxdbB4gg49M9GZhmFei55uo";
//private $key ="gnfgnfgn";
function __construct() {
if (empty(self::$key)) {
throw new ErrorException("Field key is required");
} else {
echo self::$key;
}
}
public static function translate_text($format="text")
{
echo self::$key;
$values = array(
'key' => $this->key
);
echo $values
};
}
//$transl = new Translation();
Translation::translate_text();
//echo $transl->translate_text();
//Translation::translate_text();