V
V
Vitaly2017-03-07 15:16:22
PHP
Vitaly, 2017-03-07 15:16:22

Renaming json parameter received via php script?

I am writing a bot in php for the VKontakte community. It works through the official Contact API.
There is such a method: utils.checkLink. Here is a link to the method: link It
checks if a certain link is banned on the VKontakte site.
I get a response from the request, stuff it into a variable and display it to the user, but in my case it looks like this: not_banned, but I need it to say, Not banned.
I just need to rename the received response, is it possible to do this using php.
If possible, please provide an example of usage.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
k0nsu1, 2017-03-07
@vitcorp

$answer == 'not_banned' ? echo 'Not banned' : echo 'Banned';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question