Home > Software design >  Trying to convert string into array which has a key and a value in PHP
Trying to convert string into array which has a key and a value in PHP

Time:10-26

{"Name?":"Hamz","Why do you want to join the team?":"Test","Your Date of Birth?":"2000-05-02","Your Age?":"25"}

This is the string I have, "question":"answer" then there each split by a comma.

Would anyone know how I would go about doing this in php?

CodePudding user response:

You should use json_decode as it is json:

https://www.php.net/manual/ru/function.json-decode

  • Related