you tried to generate a user token you need an App Access Token
Failed with xxxxxx isn’t valid, it should be a number.
You can update the code to spit out the body of the response if you want, and debug from there.
echo 'Failed with ’ . $info[‘http_code’];
becomes
echo 'Failed with ' . $info['http_code'] . ' - ' . $result . '<br />';
Should also debug out the URL to confirm it’s an expected URL.