Different Result When Insert Data Contain Quote on Localhost and Online MySQL Hosting
Looks PHP issue, I bet you have Magic Quotes turned off on local (good!) whereas your hosting privider has turned them on - http://www.php.net/manual/en/security.magicquotes.what.php.
When they're turned on it's the same like if you'd write:

$content    = htmlentities(addslashes($_POST['content']) );//HERE: addslashes is basically the same like your mysql_real_escape_string() - this means contents of $_POST get escaped automatically
$content_esc = mysql_real_escape_string($content);
$save = mysql_query("INSERT INTO tbl_post (title,content,date,publish) values('$title_esc','$content_esc','$date','$publish')");


I also guess that next time you're better asking such a question on StackOverflow instead;)