I've got a PHP function that gets my latest YouTube video from the API, I can access the description, but it's not formatted i.e. it's basically one line of text, is there a way to make the actually print a new line?
This is the function
function get_latestvideo($username)
{
$videos = array();
$data = "http://gdata.youtube.com/feeds/api/users/{$username}/uploads?start-index=1&max-results=4&v=2&alt=json";
foreach (json_decode(file_get_contents("$data"))->feed->entry as $video)
{
$videos[] = array(
'title' => $video->title->{'$t'},
'desc' => $video->{'media$group'}->{'media$description'}->{'$t'},
'url' => $video->content->src,
'thumbnail' => $video->{'media$group'}->{'media$thumbnail'}[1]->url,
);
}
return $videos;
}
And this is the description directly from the API
"media$description": {
"$t": "Enjoy, Like, Comment, Subscribe
GiggleSquid's Twitter: https://twitter.com/GiggleSquid
Gigglesquid's Facebook: http://www.facebook.com/GiggleSquid
GiggleSquid and dapaka delve into SimCity in a hopeless attempt to develop an efficient, bustling metropolis, will they succeed? No, probably not
Outro Music:
One-eyed Maestro by the amazing Kevin MacLeod (incompetech.com)",
"type": "plain"
},
And this is how it prints
Enjoy, Like, Comment, Subscribe GiggleSquid's Twitter: https://twitter.com/GiggleSquid Gigglesquid's Facebook: http://www.facebook.com/GiggleSquid GiggleSquid and dapaka delve into SimCity in a hopeless attempt to develop an efficient, bustling metropolis, will they succeed? No, probably not Outro Music: One-eyed Maestro by the amazing Kevin MacLeod (incompetech.com)