A
A
Alexey selftrips.ru2017-04-01 13:34:06
PHP
Alexey selftrips.ru, 2017-04-01 13:34:06

How to work with API via URL?

if you type a line in the address bar
speller.yandex.net/services/spellservice/checkText...
"page" will display

<SpellResult>
<error code="1" pos="0" row="0" col="0" len="6">
<word>malavi</word>
<s>Malawi</s>
</error>
</SpellResult>

How to get to assign a value between tags <s></s>to some variable?
If you use
speller.yandex.net/services/spellservice/checkText...
then it will simply return
<SpellResult/>Well, there are no errors. How to use such an answer to understand that there is no error?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2017-04-01
@Captain

This is XML. So you need to parse it. Start learning here

S
Sergej, 2017-04-01
@sayber

php.net/manual/en/simplexml.examples-basic.php

P
Papa, 2017-04-01
Stifflera @PapaStifflera

This service has quite intelligible documentation in Russian.
It can work in two modes: XML-/SOAP-interface and JSON- and JSONP-interface.
If you don't know SOAP/XML, use JSON.
Other questions are answered in the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question