PHP Küçük Harf Fonksiyonu

arakdaşlar, burada vereceğim kodu kendim kodladım. bazı yerlerde sadece türkçe küçük harf kullanmak isteyebilirsiniz.. normalde kullanılan strtolower ise türkçe karakterleri tam olarak çevirememekte ve de I (büyük ı) yı i olarak çevirmekte. şimdi vereceğim kod ise bu sorunu düzeltecektir..

kod şu şekilde:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
//karakter ufaltma kodu
//www.soulsmasher.net
 
function ufalt($text) {
	$search = array("Ç", "İ", "I", "Ğ", "Ö", "Ş", "Ü");
	$replace = array("ç", "i", "ı", "ğ", "ö", "ş", "ü");
	$text = str_replace($search, $replace, $text);
	$text = strtolower($text);
	return $text;
}
 
//kullanımı:
$yazi = "BEN BÜYÜK BİR YAZIYIM";
echo ufalt($yazi); //çıktısı: ben büyük bir yazıyım
?>
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

1 Response to “PHP Küçük Harf Fonksiyonu”


  1. 1 emrah üstün

    bu bana da bol bol lazım olurdu, ben de kendim yazardım aynen bu şekilde.
    PHP’nin türkçe karakterleri tanıması, sevmesi, benimsemesi, kanıksaması dileğiyle…

Leave a Reply

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a