• 04-10-2023, 18:42:19
    #10
    selcukcbk adlı üyeden alıntı: mesajı görüntüle
    maalesef tıklama işlemi gerçekleşmiyor href almıyor bu şekilde
    Peki istediğiniz şekilde gösteriyor mu? Ona göre ilerleyelim?
  • 04-10-2023, 19:32:10
    #11
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Dener misiniz hocam

    function urlDondur($metin)
    {
        $url = '/(https?:\/\/|www\.)?(\S+)/i';
        return preg_replace_callback($url, function($matches) {
            $protocol = $matches[1] ? $matches[1] : '';
            $url = $protocol . $matches[2];
            return '<a href="' . $url . '" target="_blank" title="' . $url . '">' . $url . '</a>';
        }, $metin);
    }
  • 04-10-2023, 19:34:39
    #12
    Üyeliği durduruldu
    roxxom adlı üyeden alıntı: mesajı görüntüle
    Dener misiniz hocam

    function urlDondur($metin)
    {
        $url = '/(https?:\/\/|www\.)?(\S+)/i';
        return preg_replace_callback($url, function($matches) {
            $protocol = $matches[1] ? $matches[1] : '';
            $url = $protocol . $matches[2];
            return '<a href="' . $url . '" target="_blank" title="' . $url . '">' . $url . '</a>';
        }, $metin);
    }
    bu oldu lakin hocam fakat metinide url olarak algıladı tüm hepsini url olarak algılıyor
  • 04-10-2023, 19:35:50
    #13
    Üyeliği durduruldu
    TekLanDC adlı üyeden alıntı: mesajı görüntüle
    Peki istediğiniz şekilde gösteriyor mu? Ona göre ilerleyelim?
    gösterimde sıkıntı yok hocam örnek

    site adresimiz www.siteadi.com diye bi duyuru var site adresimiz kısmını metin olarak algılıcak www.siteadi.com link olarak algılamalı konuda açtığım kodda bu oluyor fakat www göre olmuyor http olarak eklersem oluyor
  • 04-10-2023, 19:37:05
    #14
    www. kesin oluyor mu hocam onu öğrenebilir miyim ?
  • 04-10-2023, 19:39:33
    #15
    Üyeliği durduruldu
    roxxom adlı üyeden alıntı: mesajı görüntüle
    www. kesin oluyor mu hocam onu öğrenebilir miyim ?
    tüm metin ifadeyi url olarak algılıyor o şekilde anlatayım hocam
  • 04-10-2023, 19:42:22
    #16
    {
        $url = '/(https?:\/\/\S+|www\.\S+)/i';
        return preg_replace($url, '<a href="https://$0" target="_blank" title="$0">$0</a>', $metin);
    }
    Bunu dener misin hocam
  • 04-10-2023, 19:47:53
    #17
    Birde ek olarak başında https:// olmasada http:// olmasada www. olmasada normal bir metin sonu .com,org,net ile bitiyorsada url olarak algılaması için aşağıya kodu bırakıyorum, uzantıları kendin çoğaltabilirsin.

    function urlDondur($metin)
    {
        $url = '/\b((https?:\/\/|www\.)?\S+\.(com|net|org))\b/i';
        return preg_replace_callback($url, function($matches) {
            $url = (strpos($matches[0], 'http') === 0) ? $matches[0] : 'http://' . $matches[0];
            return '<a href="' . $url . '" target="_blank" title="' . $url . '">' . $matches[0] . '</a>';
        }, $metin);
    }
  • 04-10-2023, 19:49:22
    #18
    Üyeliği durduruldu
    roxxom adlı üyeden alıntı: mesajı görüntüle
    {
        $url = '/(https?:\/\/\S+|www\.\S+)/i';
        return preg_replace($url, '<a href="https://$0" target="_blank" title="$0">$0</a>', $metin);
    }
    Bunu dener misin hocam
    hocam desteğiniz için çok teşekkür ederim oldu fakat bu seferde bir önceki yapı bozuldu sizide yoruyorum kusura bakmayin

    örnek metin

    site adresimiz --> www.siteadi.com bu şekilde başarıyla çalıştı
    site adresimiz --> https://www.siteadi.com/ bu şekilde başına ekstradan 1 tane daha https ekledi sadece şu şekilde https://https//www.siteadi.com/