SORU
30 EYLÜL 2010, PERŞEMBE


PHP bir Dize içinde bir Dize Son Tekrarı Yerine?

Herkes çok hızlı bir dizenin başka bir dize ile bir dize son oluşumu değiştirmek için bir yol biliyor mu?

CEVAP
1 EKİM 2010, Cuma


Bu işlevi kullanabilirsiniz:

function str_lreplace($search, $replace, $subject)
{
    $pos = strrpos($subject, $search);

    if($pos !== false)
    {
        $subject = substr_replace($subject, $replace, $pos, strlen($search));
    }

    return $subject;
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • FUNKER530 - Veteran Community & Combat Footage

    FUNKER530 -

    25 Ocak 2007
  • Matthew Smith

    Matthew Smit

    24 Mayıs 2010
  • The Slow Mo Guys

    The Slow Mo

    15 AĞUSTOS 2010