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
Ïà¹ØÎĵµ£º
°²×°ÒÔ¼°ÅäÖÃ
1. °²×°Apache-2.2.4(Apache_Dir=D:\myspace\Apache-2.2.4)
2. ½âѹ°²×°PHP-5.2.11(PHP_Dir=D:\myspace\PHP-5.2.11)
3. ÕÒµ½PHP-5.2.11ϵÄphp.ini-dist£¬¸ÄÃûΪphp.ini
4. &nb ......
define("DB_SERVER","127.0.0.1");
define("DB_PORT",3306);
define("DB_CATALOG","uab");
define("DB_USERID","root");
define("DB_PASSWORD","");
$dsn="mysql:host=".DB_SERVER.";port=".DB_PORT.";dbname=".DB_CATALOG;
self::$__PDO=new PDO($dsn, DB_USERID, DB_PASSWORD);
//support long connection
self:: ......
ÍøÉÏ¿´ÁËsession.save_pathºÃÏñÕâ¸ösessionÎÒ»¹Ã»ÓÐÔõôÓùýÄØ£¬¿´À´ÓбØÒªÑо¿Ò»Ï°¡
½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂÎĵµ£¬¿´Ò»ÏÂÎĵµÈ·ÊµÓÐÕâô¶«Î÷£¬Ò²Ã»Óп´µ½Ê²Ã´Àý×Ó¾Í×Ô¼ºËæ±ãµÄдÁËÒ»µã¿´¿´
´úÂëÈçÏ echo session.save_path
´ò¿ªä¯ÀÀÆ÷²é¿´¾¹È»ÏÔʾ sessionsave_path ²»¶Ô°¡£¬Ôõô»áÊÇÕâ¸öÄØ£¬¿´¿ ......
<?php
class Access//AccessÊý¾Ý¿â²Ù×÷Àà
{
var $databasepath,$constr,$dbusername,$dbpassword,$link;//ÀàµÄÊôÐÔ
function Access($databasepath,$dbusername,$dbpassword)//¹¹Ô캯Êý
{
$this->databasepath=$databasepath;
$this->username=$d ......
ÒòΪ×î½ü×öÒ»¸öDIYµÄÉè¼ÆÆ÷£¬ÐèÒªÈÃÓû§Ñ¡Ôñij¸ö×ÖÌ壬²¢ÇÒÖ§³ÖÐýת£¬ÍÏÀµÈ²Ù×÷¡£Ö±½ÓʹÓÃÎı¾¿òÊDz»Ðеģ¬ÒòΪflex²»Ö§³Ö×ÖÌåµÄÖ±½ÓÐýת£¬´ó¼Ò¿ÉÒÔ³¢ÊÔһϣ¬Èç¹ûÑ¡ÔñÁËtext¿Ø¼þ£¬ÎÄ×־Ϳ´²»µ½ÁË£¬Óиö°ì·¨ÊÇ°ÑÎÄ×ÖembedǶÈëµ½swfÖÐÈ¥£¬ÕâÑù¾ÍÖ§³ÖÁË¡£
µ«ÊÇÓ¢ÎÄ»¹ºÃ£¬×ÖÌåÎļþ²»´ó£¬ÖÐÎĵĻ°¶¯éü¼¸¸öM£¬Õâ¸ö×ö·¨ºÜ²»ÏÖʵ ......