Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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();
Copy Clear