code == 100){ $contents = $oJson->data[0]; $ogDescription = addslashes(strip_tags($contents->content)); $ogTitle = $contents->title; $ogMetaTitle = $contents->meta_title != '' ? $contents->meta_title : $ogTitle; $ogMetaDescription = $contents->meta_description != '' ? $contents->meta_description : mb_substr($ogDescription, 0, 150, 'UTF-8'); if (mb_strlen($ogDescription, 'UTF-8') > 150) $ogMetaDescription .= '...'; $ogMetaKeyword = $contents->meta_keyword != '' ? $contents->meta_keyword : $ogMetaKeyword; if (preg_match_all('/src=\"(.[^"]+)"/i', $contents->content, $value) != 0) { $ogImg = trim($value[1][0]); } } } ?>