สร้างโฟลเดอร์ตัวอักษรไทย

Byphunsanit

สร้างโฟลเดอร์ตัวอักษรไทย

ตัวอย่างการใช้ function setlocale() ช่วยสร้างโฟลเดอร์ตัวอักษรไทยโดย php

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Makes Directory</title>
</head>
<body>
<?php
/* อย่าลืมสร้าง folder assets */
$root = 'assets/';
/* English */
for($a = 65; $a <= 90; $a++)
{
	mkdir($root.chr($a));
}
/* Set locale to Thai */
setlocale(LC_ALL, 'th_TH');
/* อักษรภาษาไทย */
for($a = 161; $a <= 206; $a++)
{
	mkdir($root.chr($a));
}
?>
</body>
</html>

เรื่องที่เกี่ยวข้อง

About the author

phunsanit administrator

Leave a Reply