• 18-01-2013, 19:50:22
    #1
    Üyeliği durduruldu
    Yaptığım bir php sayfada src="resimlinki" içeriğini bir türlü çağıramıyorum

    örnek kod;
    Alıntı
    <img class="alignnone size-full wp-image-333" title="resim333" src="http://www.xyzsitesi.com/wp-content/uploads//2010/08/resim333.jpeg" alt="" width="167" height="253" />
    googlde araştırdım biraz fakat bir türlü görüntüleyemedim denediğim yöntemler bunlardı

    Alıntı
    preg_match('#<img class="alignnone size-full wp-image-(.*?)" title="(.*?)" src="http://www.xyzsitesi.com/wp-content/uploads//(.*?)" alt="" width="(.*?)" height="(.*?)" />#s',$getir,$okulresim);

    preg_match_all('@<img class="alignnone size-full wp-image-(.*?)" title="(.*?)" src="http://www.xyzsitesi.com/wp-content/uploads//(.*?)" alt="" width="(.*?)" height="(.*?)" />@si',$getir,$okulresim);
    nerde hata yapıyorum ?
  • 18-01-2013, 20:48:03
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Hocam merhaba

    <?php
    	$content = '<img class="alignnone size-full wp-image-333" title="resim333" src="http://www.xyzsitesi.com/wp-content/uploads//2010/08/resim333.jpeg" alt="" width="167" height="253" />';
    	preg_match('~<img class="(.*?)" title="(.*?)" src="http://www.xyzsitesi.com/wp-content/uploads//(.*?)" alt="" width="(.*?)" height="(.*?)" />~si', $content, $image);
    	print_r($image[3]);
    ?>
    Çıktısı: 2010/08/resim333.jpeg

    Umarım işinize yarar.
  • 18-01-2013, 20:54:45
    #3
    Üyeliği durduruldu
    adursun adlı üyeden alıntı: mesajı görüntüle
    Hocam merhaba

    <?php
    	$content = '<img class="alignnone size-full wp-image-333" title="resim333" src="http://www.xyzsitesi.com/wp-content/uploads//2010/08/resim333.jpeg" alt="" width="167" height="253" />';
    	preg_match('~<img class="(.*?)" title="(.*?)" src="http://www.xyzsitesi.com/wp-content/uploads//(.*?)" alt="" width="(.*?)" height="(.*?)" />~si', $content, $image);
    	print_r($image[3]);
    ?>
    Çıktısı: 2010/08/resim333.jpeg

    Umarım işinize yarar.

    çok teşekkür ederim, burdaki kodda print_r($image[3]); sürekli 3 yerine 1 kullanıyordum