PHP convert_cyr_string()ฟังก์ชั่น
ตัวอย่าง
แปลงสตริงจากชุดอักขระหนึ่งเป็นชุดอักขระอื่น:
<?php
$str = "Hello world! æøå";
echo $str . "<br>";
echo convert_cyr_string($str,'w','a');
?>
ความหมายและการใช้งาน
ฟังก์ชัน convert_cyr_string() แปลงสตริงจากชุดอักขระ Cyrillic หนึ่งเป็นชุดอักขระอื่น
ชุดอักขระ Cyrillic ที่รองรับคือ:
- k - koi8-r
- w - windows-1251
- ฉัน - iso8859-5
- เอ - x-cp866
- d - x-cp866
- m - x-mac-cyrillic
หมายเหตุ:ฟังก์ชันนี้มีความปลอดภัยแบบไบนารี
ไวยากรณ์
convert_cyr_string(string,from,to)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
string | Required. The string to convert |
from | Required. A character that specifies what Cyrillic character-set to convert from |
to | Required. A character that specifies what Cyrillic character-set to convert to |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ส่งกลับสตริงที่แปลงแล้ว |
---|---|
รุ่น PHP: | 4+ |
❮ การอ้างอิงสตริง PHP