A
A
Alexey2015-09-13 15:58:16
css
Alexey, 2015-09-13 15:58:16

Why does yandex translate api return false?

I wrote a simple code:

$arr = array('синий','спортивный','автомобиль');
foreach($arr as $value){
  $url = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key=мой ключ&text='.$value.'&lang=en&options=1&callback=respons';
  $cont = file_get_contents($url);
  var_dump($cont);
}

But as a result I always get "bool(false) bool(false) bool(false)";
if I drive in the contents of $ url and the address bar of the browser, I get the translation.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
GLaDosSystem, 2019-04-13
@GLaDosSystem

A wildly crutch solution on pure html + css, but still:
With svg this is very easy to do.

V
Vladislav, 2019-04-14
@vos_50

Cheers The
simplest solution without extra html

C
copyhold, 2019-04-14
@copyhold

Pseudo element solution.

A
Alexander Taratin, 2015-09-13
@dzheka3d

https://github.com/chuyskywalker/rolling-curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question