| mail() | ใช้ในการส่ง mail โดยจะคืนค่า true ถ้าส่ง mail ได้สำเร็จ |
|---|---|
| gethostbyaddr() | ใช้เปลงหมายเลข IP ให้เป็น host name |
| gethostbyname() | ใช้แปลง host name ให้เป็นหมายเลข IP |
| gethostbynamel() | ใช้คืนค่าหมายเลข IP จาก host name แล้วเก็บไว้ที่ array |
| getenv() | ใช้คืนค่าข้อมูลของตัวแปร SERVER หรือ ENV โดยจะคืนค่า false ถ้าหากเกิดความผิดพลาด |
function:mail ( to, subject, message, footer, parameter );
return type:boolean, void
content:ใช้ในการส่ง mail โดยจะคืนค่า true ถ้าส่ง mail ได้สำเร็จ
example:$to = "bamboolabcode@gmail.com, bamboolabcode@hotmail.com"; $subject = "Welcome To BambooLabcode"; $message = "bamboolabcode is e-learning about programming"; mail ( $to, $subject, $message );
comment:ตัวแปร to ใช้กำหนดชื่อ email ผู้รับ ตัวแปร subject ใช้กำหนดหัวจดหมายที่ส่ง ตัวแปร message ใช้กำหนดเนื้อหาที่จะส่งไป ตัวแปร footer คือกำหนดส่วนท้ายของ mail เช่น from, cc
function:gethostbyaddr ( ip );
return type:string
content:ใช้เปลงหมายเลข IP ให้เป็น host name
example:$ip = $_SERVER [ "REMOTE_ADDR" ]; echo gethostbyaddr ( $ip );
function:gethostbyname ( hostname );
return type:string
content:ใช้แปลง host name ให้เป็นหมายเลข IP
example:echo gethostbyname ( "www.bamboolabcode.com" );
function:gethostbynamel ( hostname );
return type:array
content:ใช้คืนค่าหมายเลข IP จาก host name แล้วเก็บไว้ที่ array จะใช้ในกรณีที่เป็น web site ขนาดใหญ่
example:print_r ( gethostbynamel ( "www.bamboolabcode.com" ) );
function:getenv ( string );
return type:string
content:ใช้คืนค่าข้อมูลของตัวแปร SERVER หรือ ENV โดยจะคืนค่า false ถ้าหากเกิดความผิดพลาด
example:echo getenv ( "REMOTE_HOST" ); echo $_SERVER["REMOTE_HOST"];