0

I get data from file_get_contents method and convert this data to JSON but when data contain an emoji character, I cannot give this field in JSON file and store it in database. I changed table collation to utf8mb4_general_ci but do not work my code

$update = file_get_contents("php://input");
$update = json_decode($update, JSON_UNESCAPED_UNICODE);

I tried to get JSON in $update and I also tried method below:

$firstname =isset($update["message"]["from"]["first_name"]) ? $update["message"]["from"]["first_name"] : "";
$lastname = isset($update["message"]["from"]["last_name"]) ? $update["message"]["from"]["last_name"] : "";
xKobalt
  • 1,498
  • 2
  • 13
  • 19
kamal
  • 330
  • 3
  • 13

0 Answers0