This is my dynamic title and meta description update code;
$titlecek=mysql_query("SELECT bahisisim,bahisiaciklama,URL FROM bahis WHERE id='$bahisid'");
$titlecekx=mysql_fetch_array($titlecek);
echo "<title>" . mb_strtolower($titlecekx[0],'UTF-8') . "</title>";
echo '<META NAME="Description" CONTENT="' . mb_strtolower($titlecekx[1],'UTF-8') . '">';
But when I try to share my page at Facebook it looks like;
http://666kb.com/i/c6st3ke4u4hqaem42.gif
By the way its HTML codes are like these at output;
<title>bu bahise gelen evet says tek say olacak</title><META NAME="Description" CONTENT="bu bahise 2 gün içerisinde gelen evet oyu sayısı tek sayı olacak. (ilkokullu editi: 2'nin katları çift sayıdır, 0 çift sayıdır)">
How can I solve this issue?
Make sure that you tell what character encoding the site uses. Without that, even if you correctly output the values in UTF-8 format, the consumer (in this case Facebook) will not know what encoding to use when reading your data.
One way to do that is using this:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
In HTML5, you can also say:
<meta charset="UTF-8" />
Every time you change your meta tags, you'll have to run your URL through the Facebook Debugger to make sure that Facebook discards it's cached version of your meta tags.
Taken from the Facebook Open Graph Protocol documentation, under the "Editing Meta Tags" section -
For the changes to be reflected on Facebook, you must force your page to be scraped. The page is scraped when an admin for the page clicks the Like button or when the URL is entered into the Facebook URL Linter Debugger.
Final solution;
$turkceler= array("ç", "ğ" , "ı", "ö", "ş", "ü");
$degistir= array("ç", "ğ", "ı", "ö", "ş", "ü");
echo "<title>" . str_replace($turkceler,$degistir,mb_strtolower($titlecekx[0])) . "</title>";
echo '<META NAME="Description" property="og:description" CONTENT="' . substr(strip_tags(str_replace($turkceler,$degistir,mb_strtolower($titlecekx[1]))),0,200) . "..." . '">';
echo '<meta property="og:image" content="' . $titlecekx[2] . '"/>';