[code]<?
class smtp
{
/* Public Variables */
var $smtp_port;
var $time_out;
var $host_name;
var $log_file;
var $relay_host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/* Constractor */
function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass)
{
$this->debug = FALSE;
class smtp
{
/* Public Variables */
var $smtp_port;
var $time_out;
var $host_name;
var $log_file;
var $relay_host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/* Constractor */
function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass)
{
$this->debug = FALSE;
» 阅读全文
[code]<?php
error_reporting(E_ALL);
ini_set('display_errors',true);
/*
Class to handle spidering, scraping, etc
How to use it:
- simplest way is to spiderStart then repeatedly call spiderNextPage and carry out whatever tasks you'd like on retrieved pages
Capabilities:
Spider from a start page matching links according to regexps (regexps can vary according to crawl depth)
Retrieve a page as a string
Extract Links from a page (optionally according to regexps)
CLASS: spiderScraper
error_reporting(E_ALL);
ini_set('display_errors',true);
/*
Class to handle spidering, scraping, etc
How to use it:
- simplest way is to spiderStart then repeatedly call spiderNextPage and carry out whatever tasks you'd like on retrieved pages
Capabilities:
Spider from a start page matching links according to regexps (regexps can vary according to crawl depth)
Retrieve a page as a string
Extract Links from a page (optionally according to regexps)
CLASS: spiderScraper
» 阅读全文
/**
* Grab an e-mail address out of a string
*
* @param int $level The log level. See sys_log() of the PHP docs
* @param string $message The log message
* @access public
* @return void
*/
function get_email_from_string($email)
{
if (preg_match("/(b)([w.-]+)(@)([w.-]+)([A-Za-z]{2,4})b/i", $email, $matches))
{
return $matches[0];
} else
{
return false;
}
}
?>
* Grab an e-mail address out of a string
*
* @param int $level The log level. See sys_log() of the PHP docs
* @param string $message The log message
* @access public
* @return void
*/
function get_email_from_string($email)
{
if (preg_match("/(b)([w.-]+)(@)([w.-]+)([A-Za-z]{2,4})b/i", $email, $matches))
{
return $matches[0];
} else
{
return false;
}
}
?>
$html = "
<h1>Articles</h1>
<a class='cla1' target=_blank href='http://www.bac.com/database1/index.html' style='color:red'>数据库1</a>
<a class='cla1' target=_blank href='http://www.bac.com/database2/index.html' style='color:red'>数据库2</a>
";
preg_match_all("{<a[^>]+href\s*=\s*'(.+?)'[^>]*>(.+?)</a>}i", $html, $matches);
<h1>Articles</h1>
<a class='cla1' target=_blank href='http://www.bac.com/database1/index.html' style='color:red'>数据库1</a>
<a class='cla1' target=_blank href='http://www.bac.com/database2/index.html' style='color:red'>数据库2</a>
";
preg_match_all("{<a[^>]+href\s*=\s*'(.+?)'[^>]*>(.+?)</a>}i", $html, $matches);
一个URL的正则 收藏自cid73
httpd.conf
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
<Directory "D:\wwwroot/ZendStudioServer">
Options Indexes
DirectoryIndex index.html index.php
</Directory>
[Zend]
zend_extension_manager.optimizer_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\Optimizer-2.6.1"
zend_extension_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\ZendExtensionManager.dll"
zend_optimizer.optimization_level=15
zend_extension_manager.debug_server_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\Debugger-5.1.0"
studio.install_dir="D:\soft\Zend\ZendStudioServer-5.1.0"
zend_debugger.expose_remotely=allowed_hosts
zend_gui.ini_modifier="D:\soft\Zend\ZendStudioServer-5.1.0\sbin\ini_modifier.exe"
zend_debugger.deny_hosts=
zend_gui_password=1e63bbb9760f7e977e7f3041f960ef06
zend_debugger.allow_hosts=127.0.0.1/32
zend_ini_file="D:\soft\Zend\ZendStudioServer-5.1.0\etc\zend.ini"
wwwfile
下载文件
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
<Directory "D:\wwwroot/ZendStudioServer">
Options Indexes
DirectoryIndex index.html index.php
</Directory>
[Zend]
zend_extension_manager.optimizer_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\Optimizer-2.6.1"
zend_extension_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\ZendExtensionManager.dll"
zend_optimizer.optimization_level=15
zend_extension_manager.debug_server_ts="D:\soft\Zend\ZendStudioServer-5.1.0\lib\Debugger-5.1.0"
studio.install_dir="D:\soft\Zend\ZendStudioServer-5.1.0"
zend_debugger.expose_remotely=allowed_hosts
zend_gui.ini_modifier="D:\soft\Zend\ZendStudioServer-5.1.0\sbin\ini_modifier.exe"
zend_debugger.deny_hosts=
zend_gui_password=1e63bbb9760f7e977e7f3041f960ef06
zend_debugger.allow_hosts=127.0.0.1/32
zend_ini_file="D:\soft\Zend\ZendStudioServer-5.1.0\etc\zend.ini"
wwwfile
下载文件 



