My facebook app uses facebook’s ui method, to which you pass json. My php variable’s however might contain apostrophe’s… what is the best way to preserve them, while properly passing them to the fb method?
FB.ui(
{
method: 'feed',
name: '<? echo $tname; ?>',
link: '<? echo $short; ?>',
caption: '<? echo $description; ?>'
},
use json_encode
$myJSONis now contains a string with your data in JSON format and ready to echo to the page.