Reputation: 172
I'm getting an event using Facebook Graph API and PHP using the following code:
$id = '160307307413666';
$FBpage = file_get_contents('https://graph.facebook.com/'. $id);
$FBdata = json_decode($FBpage);
echo $FBdata->description;
The problem is when using json_decode($FBpage); i loose all the /n (new line) that i would like to render.
Any help would be appreciated
Upvotes: 0
Views: 458
Reputation: 23292
use this function
nl2br
which will convert all new lines \n
to <br/>
tag
Upvotes: 1
Reputation: 3644
i assume you're looking for
echo '<pre>';
echo $FBdata->description;
echo '</pre>';
Upvotes: 5