json_decode need help

This decodes to a object so;

$getcontents = json_decode($getcontents);
$twitchname = $getcontents->name;

If you want an array

$getcontents = json_decode($getcontents, true);
$twitchname = $getcontents['name'];

http://php.net/json_decode