Ò»¸öPHPµÄUDPº¯Êý
//Èç¹û$waitAckSecΪ0£¬Ôò·µ»Ø³É¹¦·¢Ë͵Ä×Ö½ÚÊý
//Èç¹û$waitAckSec´óÓÚ0£¬Ôò·µ»Ø·¢Ëͺó½ÓÊÕµ½µÄÄÚÈÝ
//ÈκÎÇé¿öÏ£¬Ê§°Ü¶¼·µ»ØFALSE
function SendUDP($host, $port, $buff, $waitAckSec=0)
{
$result = FALSE;
$socket = ($result=@socket_create(AF_INET, SOCK_DGRAM, SOL_UDP));
if ($socket)
{
$result = @socket_sendto($socket, $buff, strlen($buff), 0, $host, $port);
if ( $waitAckSec>0 )
{
$result = FALSE;
$read = array($socket);
$write = NULL;
$except = NULL;
if ( @socket_select($read, $write, $except, $waitAckSec) > 0 )
{
$fromHost = '';
$fromPort = 0;
@socket_recvfrom($socket, $result, 3, 0, $fromHost, $fromPort);
}
}
@socket_close($socket);
}
return $result;
}
Ïà¹ØÎĵµ£º
֮ǰÍøÒ³µÄchartsetÓõÄÊÇutf-8£¬ÎļþÒ²ÓÃutf-8£¬È»ºóÓÃfopen()´´½¨Ò»¸öÖÐÎÄÎļþÃûµÄÎļþʱÎÊÌâ¾Í³öÀ´ÁË£¬ÎļþÃû¶¼ÊÇÂÒ
Â룡
²é¿´Á˺ܶàÎĵµÊÔÁ˲»ÉÙ·½·¨¶¼½â¾ö²»ÁË£¬±¾À´Ïë×ÅÓñðµÄ·½·¨ÈƹýÕâ¸öÎÊÌ⣬ºöÈ»ÄÔ×ÓÀïÉÁ¹ýWindowsĬÈϵÄÎÄ×Ö±àÂëÊÇansi£¬È»ºóÔÙ
baiduÁËһϣ¬Ö¤ÊµÁËÕâµã£¬ËùÒÔÎÒµÄÍøÒ³Ò²Ó¦¸ÃÊÇansi±àÂë²ÅÄÜʹ´ ......
<?php
@mysql_connect("localhost", "root","1981427") //Ñ¡ÔñÊý¾Ý¿â֮ǰÐèÒªÏÈÁ¬½ÓÊý¾Ý¿â·þÎñÆ÷
or die("Êý¾Ý¿â·þÎñÆ÷Á¬½Óʧ°Ü");
$dbs = mysql_list_dbs(); //µ÷ÓÃmysql_list_dbsº¯Êý
while ($array = mysql_fetch_row($dbs)) //Ñ»·Êä³öËùÓеÄÊý¾Ý¿âÃû³Æ
{
echo "$array[0]<BR>";
}
?>
& ......
function multi($num, $perpage, $curpage, $mpurl) {
$multipage = '';
$mpurl .= strpos($mpurl, '?') ? '&' : '?';
if($num > $perpage) {
$page = 10;
$offset = 5;
$pages = @ceil($num / $perpage);
if($pag ......
The define() function defines a constant.
define()º¯ÊýµÄ×÷ÓÃÊÇ£º¶¨ÒåÒ»¸ö³£Á¿¡£
Constants are much like variables, except for the following differences:
³£Á¿[constant]Óë±äÁ¿[variable]ÓкܶàÏàËƵĵط½£¬Òò´Ë£¬ºÜÈÝÒ×»ìÏý£»ÏÂÃ棬ÎÒÃÇÁоÙһϳ£Á¿[constant]Óë±äÁ¿[variable]Ö®¼äµÄ²»Í¬µã£º
A constant's ......
תÔØ×Ô£ºhttp://www.ibm.com/developerworks/cn/opensource/os-php-5.3unicode/index.html
Web
ÊÇÒ»¸öÓÃÀ´¿ª·¢È«ÇòÐÔÓ¦ÓóÌÐòºÍ·þÎñµÄÀíÏëƽ̨¡£Òª´´½¨Ò»¸öÕæÕý¾ßÓйú¼Ê÷ÈÁ¦µÄÓ¦ÓóÌÐò£¬±ØÐë¶ÔËü½øÐе÷ÕûÒÔ±ãÄܹ»ÒÔ¸÷ÖÖÓïÑԺͱàдϵͳ´¦ÀíºÍÏÔʾÊý¾Ý¡£
³£ÓÃËõд´Ê
HTML£º
³¬Îı¾±ê¼ÇÓïÑÔ
HTTP£º
³¬Îı¾´« ......