Why this php code does not receive the json file from the telegram server?

Viewed 20

I've got a question about writing telegram robot with php. I have a line of code which gets a json file from server of telegram and imports it into a variable; using file put contents function, it imports the variable's amount into a txt file and saves it beside the pho on the server. but there is a probmel with it, this part of code doesn't work. The host and domain are both free and has been tested. php file's adress has been set on the set webhook method on the server. here is the code I've used for getting the amount of json in teleram:

<?php

$var=file_get_contents("php://input");
file_put_contents('json.txt',$var);

?>
0 Answers
Related