ftp_set_option

(PHP 4 >= 4.2.0, PHP 5)

ftp_set_option -- ÉèÖø÷ÖÖ FTP ÔËÐÐʱѡÏî

˵Ã÷

bool ftp_set_option ( resource ftp_stream, int option, mixed value )

Èç¹ûÑ¡ÏîÄܹ»±»ÉèÖ㬷µ»Ø TRUE£¬·ñÔò·µ»Ø FALSE¡£Èç¹û²ÎÊý option ²»±»Ö§³Ö»òÕ߸ø¶¨µÄ²ÎÊý value µÄÖµÓë²ÎÊý option ²»Æ¥Å䣬Ôò»áͬʱ·µ»ØÒ»Ìõ¾¯¸æÐÅÏ¢¡£

´Ëº¯ÊýÓÃÀ´ÉèÖøø¶¨ FTP ¾ä±úµÄ¸÷ÖÖÔËÐÐʱ¼äÑ¡Ïî¡£²ÎÊý value µÄֵȡ¾öÓÚ²ÎÊý option µÄ¸Ä±ä¡£½ØÖ¹µ½Ä¿Ç°£¬±»Ö§³ÖµÄÑ¡ÏîÓÐ:

表格 1. Supported runtime FTP options

FTP_TIMEOUT_SEC¸Ä±äÍøÂç´«ÊäµÄ³¬Ê±Ê±¼ä¡£²ÎÊý value ±ØÐëΪÕûÊýÇÒ´óÓÚ 0¡£Ä¬Èϵij¬Ê±Ê±¼äΪ 90 Ãë¡£
FTP_AUTOSEEKµ±´ËÑ¡Ïî´ò¿ªÊ±£¬´ø resumepos »ò startpos ²ÎÊýµÄGET »ò PUT ÇëÇó ½«ÏȼìË÷µ½ÎļþÖÐÖ¸¶¨µÄλÖᣴËÑ¡ÏîĬÈÏÊÇ´ò¿ªµÄ¡£

例子 1. ftp_set_option() ʵÀý

<?php
// ÉèÖÃÍøÂç´«Ê䳬ʱʱ¼äΪ 10 Ãë
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
?>

²Î¼û ftp_get_option()¡£