Whenever I submit a comment to facebook, it returns the id in this format:
{"id":"1178215146_2244093420005"}
Do you know how I can get this value out with PHP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The string you pasted is JSON. Use
$arr = json_decode($val, true);. You’ll get an associative array, and you can access the value with:$arr['id'].json_decodedocumentation