gelen Öne görüntüyü alın ->Ben kullanıcı sonrası içeriğindeki resim URL'sini girer bir blog sistemine sahip yayınlanan içerikten
hey how are you <img src="www.example.com/image.png" style="height=100px;">
Sonra bu [img src] satırı bulun ve özellikli olarak kullanmak istiyorum $ içeriği
preg_match('/(<img .*?>)/', $content, $img_tag);
$feature = $img_tag[0]; // This preg_match finds img src tag and provide me
$regex = '~<img.*?src=[\'"](?:view-source:)?([^"\']+).*?\/?>~';
$featured = preg_replace($regex, "$1", $feature);
herkes dışarı çimdik sorun He Formundan Yayınlanan içeriği: this-> www.example.com/image.png
buradagibi görüntü denedim budur yeniden? Şimdi
preg_match_all('/<img.*src="(.*)"/', $content, $matches);
$featured = isset($matches[1][0]) ? $matches[1][0] : null;
beni burada neler olduğunu açıklayalım:
Yani "src" özniteliğini postadaki ilk "" etiketinden mi almak istiyorsunuz? Yoksa bir şey mi özlüyorum? –