Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPÌáÈ¡8684¹«½»Êý¾Ý

×î½üÒ»ÄêÀ´Ò»Ö±ÔÚʹÓÃfedora£¬·¢ÏÖlinuxÕæÊÇÌ«ÊʺÏÎÒÁË£¬Ï²»¶Ð´³ÌÐò£¬×Ô¼ºÏ¹µ¹ÌÚ£¬°¦windowsÎóÎÒ´óºÃÄ껪……
ÓÃPHPдÁËÒ»¶Î³ÌÐòÓÃÓÚÌáÈ¡ÍøÒ³ÖеÄÊý¾Ý£¬ÏàÐÅËÑË÷ÒýÇæÒ²ÊDz¶àµÄÏë·¨£¬Ö»²»¹ýËûÃÇÊý¾Ý¶à£¬Ëã·¨ºÃЩ£¬ºÇºÇ
[php]
<?php
/*
*´ËÎļþµÄÄ¿±êÊÇ×Ô¶¯ËѼ¯´æ´¢8684ÉϵÄÉîÛÚÊй«½»Êý¾Ý
*
*ÓÉÓÚhttp»ñµÃµÄÍøҳΪgbk±àÂëPHPÐèҪת»»£¬Ö»Äܽ«PHPÖØбàÒë
*/
//ÔØÈësimple_html_domÀà·ÖÎöHTMLÎļþ
include 'simple_html_dom.php';
//´´½¨Ò»¸öSQLiteÊý¾Ý¿âÓÃÓÚ´æ´¢Êý¾Ý
$db = new SQLite3 ('BusData.db');
if ($db) //Êý¾Ý¿â´´½¨³É¹¦
{
//´´½¨Õ¾µãÃû±í
$db->exec('CREATE TABLE stationName (id INTEGER PRIMARY KEY AUTOINCREMENT,sName STRING)');
//´´½¨Ïß·±ísName,sNote,sTo,sfrom·Ö±ð´æ´¢Ïß·Ãû£¬±¸×¢£¬È¥³Ì£¬»Ø³Ì
$db->exec('CREATE TABLE Line (sName STRING, sNote STRING, sTo STRING, sfrom STRING)');
}
analysis($db, 'http://shenzhen.8684.cn/x_24f5dad9');
$db->close ();
echo "Congratulations! Write Sucessfully!";
//******************
//·ÖÎöÊý¾Ý,²åÈëÊý¾Ý²¿·Ö
//******************
function analysis($db, $url)
{
$html = new simple_html_dom ();
$html->load_file ($url); //ÔØÈëHTMLÎļþ£¬¿ÉÒÔ´Ó±¾µØ£¬Ò²¿ÉÊÇURL
$LName = ''; //ÓÃÓڼǼ¹«½»Ïß·Ãû³Æ
foreach ($html->find ('div[id=show] h2 a') as $lineName)
{
// echo mb_strlen($lineName->plaintext).'word<p>';±¾À´ÏëÈ¥µô¹«½»Ãû³ÆÖеđ·'×Ö£¬²»¹ýºóÀ´·¢ÏÖÕû¸öÃüÃû²»±ê×¼£¬ÒªÈ¥¿ÉÄÜÈ¥µÄÂÒÆß°ËÔãÁË
//¼Ç¼¹«½»Â·ÏßÃû³Æ
$LName = $LName.mb_strcut(mb_convert_encoding($lineName->plaintext,'UTF-8','gbk'),6);
}
//¼Ç¼Ïß·±¸×¢ÐÅÏ¢:
$note = '|';
foreach ($html->find ('div[id=show] li') as $Note)
$note = $note.mb_convert_encoding($Note->plaintext,'UTF-8','gbk').'|'; //½«±¸×¢Á¬½Ó
$i = 0; //ÓÃÒÔÅжÏÐг̣¨È¥³Ì£¯»Ø³Ì£©
$s_To = '.'; //¼Ç¼ȥ³Ì·Ïß
$s_from = '.'; //¼Ç¼»Ø³Ì·Ïß
//Êä³ö¹«½»Õ¾µãÐÅÏ¢
foreach ($html->find ('span') as $element)
{
$i++; //¿ØÖƱäÁ¿×ÔÔö
//iΪÆæÊýʱÅжÏΪȥ³Ì
if ($i % 2)
{
foreach ($element->find ('a


Ïà¹ØÎĵµ£º

php·¢ËÍÓʼþ

ÔÚphpÖз¢ËÍÓʼþ¿ÉÒÔÓÃ×Ô´øµÄmail()º¯Êý£¬µ«ÊÇÕâ¸öº¯Êý²»×ãµãºÜÃ÷ÏÔ£¬×îÖ÷ÒªÊÇÔÛ±¾»úÉÏûÓа²×°smtp·þÎñ¾Íû·¨Ê¹ÓÃmail()¡£
µ±È»ÏÖÔÚ»¹ÓÐphpÆäËûµÄ²å¼þ¡¢ÀàʲôµÄ£¬ÄÇЩҲÐí¹¦ÄÜÆëÈ«£¬¿ÉÊÇÍâ¼Ó¾Í¸Ð¾õ²»Ë¬¡£
ÄÇÆäËû°ì·¨µÄ»°£¬Ò»°ã»áÏ뵽ͨ¹ýSMTP·þÎñÆ÷À´·¢ËÍÓʼþ£¬µ«ÊÇÒ²»á²úÉúһϵÁÐÎÊÌ⣨¾ßÌåÓÐÄÄЩÎÊÌâ¿É¼û²Î¿¼×ÊÁÏ"ÎÞÐ ......

php session

ÍøÉÏ¿´ÁËsession.save_pathºÃÏñÕâ¸ösessionÎÒ»¹Ã»ÓÐÔõôÓùýÄØ£¬¿´À´ÓбØÒªÑо¿Ò»Ï°¡
½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂÎĵµ£¬¿´Ò»ÏÂÎĵµÈ·ÊµÓÐÕâô¶«Î÷£¬Ò²Ã»Óп´µ½Ê²Ã´Àý×Ó¾Í×Ô¼ºËæ±ãµÄдÁËÒ»µã¿´¿´
´úÂëÈçÏ     echo session.save_path
´ò¿ªä¯ÀÀÆ÷²é¿´¾¹È»ÏÔʾ sessionsave_path ²»¶Ô°¡£¬Ôõô»áÊÇÕâ¸öÄØ£¬¿´¿ ......

phpÉú³Éexcel

excelÕâÀàÎļþÆäʵ¾ÍÊÇÌØÊâ¸ñʽµÄÎı¾Îļþ£¨Ó¦¸ÃËùÓиñʽ¶¼ÊÇÌØÊâ¸ñʽµÄÎı¾ÎļþºÍ¶þ½øÖÆÎļþ£©£¬
excel²»Í¬µÄÐÐÌåÏÖÔÚÎı¾ÖеĻ»ÐУ¬ÀïÃæµÄÐèҪתÒåµÄ×Ö·û°üÀ¨,\ºÍ\r\nÕâÁ½¸ö£¬Óöµ½ÕâЩ×Ö·ûµÄʱºòÕâ¸öµ¥Ôª¸ñÐèÒªÓÃ""¸ñ¿ª ......

PHP IPº¯Êý

<?php
$start = ip2long('192.168.1.1');
$start = sprintf("%u", $start) ;
$end = ip2long('192.168.1.50');
$end = sprintf("%u", $end) ;
for ($start; $start<$end; $start++){
echo long2ip($start)."<br>";
}
?> ......

php Á¬½ÓÊý¾Ý¿âµÄÀà

<?php
class Access//AccessÊý¾Ý¿â²Ù×÷Àà
{
var $databasepath,$constr,$dbusername,$dbpassword,$link;//ÀàµÄÊôÐÔ
function Access($databasepath,$dbusername,$dbpassword)//¹¹Ô캯Êý
{
$this->databasepath=$databasepath;
$this->username=$d ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ