substr'in son aldığı harf eğer Türkçe bir harf ise karakter hatası oluşturacaktır. Bu nedenle mb_substr kullanmanız daha doğru olur.