I tried to show a description from the YouTube API to p element but it's not working. I think the problem is with the quotes, single quote and new line; ie. "" , '' and \n.
This is the description text:
Another contestant attempts to overcome 'Head Case'! Will Daniel be able to "master" his fear of the unknown and be able to carry on singing?\n\nSubscribe for more awesome clips!\n\nSubscribe now!
$description = $vid["items"][0]["snippet"]["description"];
echo "<script>$('.pClass:nth-of-type(4)').text($description);</script>";
Note that it's working like this: $('.pClass:nth-of-type(4)').text('test');, but it's not working when read from the API.
$description