| random_string() | ใช้สุ่ม ข้อความ ตามจำนวนที่กำหนด |
|---|---|
| repeater() | ใช้แสดงข้อมูลที่กำหนด ซ้ำๆกัน ตามจำนวนที่กำหนด |
| reduce_double_slashes() | ใช้เปลี่ยน double slashes ให้เป็น single slashes ยกเว้นคำว่า http:// |
| trim_slashes() | ใช้ลบ slashes ที่อยู่ด้านหน้าสุด และด้านหลังสุด ออก |
| quotes_to_entities() | ใช้เปลี่ยน double quote และ single quote ให้เป็นสัญลักษณ์พิเศษของภาษา html |
| strip_quotes() | ใช้ลบ double quote และ single quote ออก |
function:random_string ( type, length )
return type:string
content:ใช้สุ่ม ข้อความ ตามจำนวนที่กำหนด
example:echo random_string ( "alnum", 8 );
comment:ตัวแปร type = alnum คือจะสุ่มทั้งตัวเลขและตัวอักษรปนกัน ตัวแปร type = numeric คือจะสุ่มตัวเลขเท่านั้น ตัวแปร type = nozero คือจะสุ่มตัวเลขที่ไม่มีศูนย์ ตัวแปร type = unique คือจะสุ่มค่าที่ได้จากการเข้ารหัส md5 และไม่ต้องกำหนดตัวแปร length
function:repeater ( text, count )
return type:string
content:ใช้แสดงข้อมูลที่กำหนด ซ้ำๆกัน ตามจำนวนที่กำหนด
example:echo repeater ( "bamboo", 5 );
function:reduce_double_slashes ( text )
return type:string
content:ใช้เปลี่ยน double slashes ให้เป็น single slashes ยกเว้นคำว่า http://
example:$path = "http://www.bamboolabcode.com//index.php"; echo reduce_double_slashes ( $path );
function:trim_slashes ( text );
return type:string
content:ใช้ลบ slashes ที่อยู่ด้านหน้าสุด และด้านหลังสุด ออก
example:$path = "/index.php/project/form/"; echo trim_slashes ( $path );
function:quotes_to_entities ( text )
return type:string
content:ใช้เปลี่ยน double quote และ single quote ให้เป็นสัญลักษณ์พิเศษของภาษา html เช่น เปลี่ยนจาก double quote เป็น "
example:$text = "Bamboo's \"LabCode\""; echo quotes_to_entities ( $text );
function:strip_quotes ( text )
return type:string
content:ใช้ลบ double quote และ single quote ออก
example:$text = "Bamboo's \"LabCode\""; echo strip_quotes ( $text );