ʹÓÃÌÚѸµÄapi½Ó¿Ú£¬php»ñÈ¡ipµØÖ·ÒÔ¼°ËùÔÚ³ÇÊÐ
http://fw.qq.com/ipaddress·µ»ØÀàËÆ£ºvar IPData = new Array("61.51.71.183","","±±¾©ÊÐ","");
<?php
function get_ip_place(){
$ip=file_get_contents(http://fw.qq.com/ipaddress);
$ip=str_replace('"',' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$a);
return $b;
}
$ip=get_ip_place();
print_r($ip);
?>
Ïà¹ØÎĵµ£º
Òªä¯ÀÀ±íÖеļǼÐèÒªÖ´ÐÐÒÔϼ¸²½²Ù×÷£º
(1) Ö´ÐÐÒÔÏÂSQLÓï¾ä£º
select field1,field2,field3,...from $table_name
ÆäÖÐfield1,field2,field3±íʾµÄÊÇÐèÒª´Ó±íÖвéѯµÄ×Ö¶ÎÃû³Æ£º$table_nameΪ±íµÄÃû³Æ¡£
(2)ʹÓÃPHP MSSQLÀà¿âÖеÄmssql_fetch_array()º¯Êý¶ÁÈ¡Ö´ÐÐSQLÓï¾äËù·µ»ØµÄ½á¹û¼¯¡£¸Ãº¯ÊýµÄÓï·¨¸ñʽÈçÏ´úÂ룺 ......
ץȡµ½µÄÄÚÈÝÔÚͨ¹ýÕýÔò±í´ïʽ×öһϹýÂ˾͵õ½ÁËÄãÏëÒªµÄÄÚÈÝ£¬ÖÁÓÚÈçºÎÓÃÕýÔò±í´ïʽ¹ýÂË£¬ÔÚÕâÀï¾Í²»×ö½éÉÜÁË£¬ÓÐÐËȤµÄ£¬ÒÔϾÍÊǼ¸ÖÖ³£ÓõÄÓÃphpץȡÍøÒ³ÖеÄÄÚÈݵķ½·¨¡£
1.file_get_contents
PHP´úÂë
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<?php
$url = "http://www.jb51.net";
$contents = file_get_contents($url);
// ......
ÓÐÕâôһ¶ÎHTML£¬±È½Ï²»¹æÔòµÄ£¬Èç¹ûÒªÌáÈ¡ÆäÖеÄÁ´½ÓµØÖ·ºÍÁ´½ÓÃû³Æ£¬ÔõôŪ£¿ ÄÚÈÝÀ´×Ôdedecms
//HTML
$str = '<a id="top8" href="http://list.mp3.baidu.com/song/A.htm?top8" class="p14" target="_top">¸èÇúÁбí</a><br><a target="_blank" id="bp" href="http://list.mp3.baidu.com/list/ba ......
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [\u4e00-\u9fa5]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^\x00-\xff]
ÆÀ×¢£º¿ÉÒÔÓÃÀ´¼ÆËã×Ö·û´®µÄ³¤¶È£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
Æ¥Åä¿Õ°×ÐеÄÕýÔò±í´ïʽ£º\n\s*\r
ÆÀ×¢£º¿ÉÒÔÓÃÀ´É¾³ý¿Õ°×ÐÐ
Æ¥ÅäHTML±ê¼ÇµÄÕýÔò±í´ïʽ£º ......
ÔÚPHPÖУ¬ÎļþÉÏ´«Ò»°ãÊÇͨ¹ýmove_uploaded_file£¨£©À´ÊµÏֵġ£
bool move_uploaded_file ( string filename, string destination )±¾º¯Êý¼ì²é²¢È·±£ÓÉ filename Ö¸¶¨µÄÎļþÊǺϷ¨µÄÉÏ´«Îļþ£¨¼´Í¨¹ý PHP µÄ HTTP POST ÉÏ´«»úÖÆËùÉÏ´«µÄ£©¡£Èç¹ûÎļþºÏ·¨£¬Ôò½«ÆäÒƶ¯ÎªÓÉ destination Ö¸¶¨µÄÎļþ¡£
Èç¹û filename ²»ÊǺϷ ......