
$og_image = '';
$decoded = html_entity_decode($article['content'] ?? '', ENT_QUOTES, 'UTF-8');
if (preg_match('/]+src=["\']([^"\']+)["\']/i', $decoded, $m)) {
$src = $m[1];
if (strpos($src, 'http') !== 0) {
$og_image = 'https://www.zmn-zx.com' . ltrim($src, '/');
} else {
$og_image = $src;
}
}
if (empty($og_image)) {
$og_image = 'https://fs.zmn-zx.com/images/article-default.jpg';
}