Answer the question
In order to leave comments, you need to log in
Variable in php associative array key?
I am writing a bot for the VK community in php.
Faced a problem:
There is an associative array of the form: 'Question' => "Answer"
I need to find out the weather in the city that the user specifies.
I know the weather through openweathermap, the city is specified in a separate script.
I need the name of the city written by the user in the request to be substituted into the script: Weather <city>, and in response, the weather for the specified city was sent, and in the case of simply entering: Weather, an error was displayed.
How to implement it in php? Is it even possible?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question