PHP

[email protected]

   

การใช้ฟังก์ชั่น เกี่ยวกับตัวอักษร


substr(string source, int begin, int [length]);
    ใช้งาน:     echo substr("การทดสอบ",3,2);  ==>   Output: ทด
trim(string source);
    ใช้งาน:      echo trim(" การทดสอบ ");   ==>  Output: "การทดสอบ"

chr();
    ใช้งาน:     echo chr(84);  ==>   Output: I

ord();
    ใช้งาน:     echo ord("A");  ==>   Output: 65

strlen();
    ใช้งาน:     echo strlen("ทดสอบ");  ==>   Output: 5

printf(); และ sprintf();
    ใช้งาน:     d-decimal,b-binary,o-octal,x-hexadecimal,c-character,f-double,s-string
    echo printf("%04d-%02d-%02d", $year, $month, $day);  ==>   Output: 2005-07-11

stripslashes();
    ใช้งาน:     echo stripslashes(help "me");  ==>   Output: help \"me\"


สร้างเมื่อวันที่ : 11-07-2548

เกี่ยวกับเรา | Site Map | Privacy Policy | ติดต่อเรา | ©2005 Company Name

Hosted by www.Geocities.ws

1