goland 正则爬取SFZ号码

goland 正则爬取SFZ号码

package main import ( "fmt" "io/ioutil" "net/http" "os" "regexp" ) var ( //3-30625-1970-04-26-0474 //reLink = `[1-6]\d{5}-(19\d{2})|(20(0\d)|(1[0-8]))-(0[1-9])|(1[012])-((0[1-9])|([12]\d)|(3[01]))-\d{3}[\dx]` //需要根据实际...

Goland 2021-10-03 AM 2241℃ 0条
goland 正则爬取链接

goland 正则爬取链接

package main import ( "fmt" "io/ioutil" "net/http" "os" "regexp" ) var ( reLink = `<a[\s\S]+?href="(http[\s\S+?])"` //需要根据实际情况书写规则 ) func HandleError(err error, when string) { if err != nil { fmt...

Goland 2021-10-03 AM 1678℃ 0条
goland 正则爬取邮箱地址

goland 正则爬取邮箱地址

package main import ( "fmt" "io/ioutil" "net/http" "os" "regexp" ) var ( reEmail = `[\w\.]+@\w+\.[a-z]{2,3}(\.[a-z]{2,3})?` ) func HandleError(err error, when string) { if err != nil { fmt.Println(when, err) ...

Goland 2021-10-03 AM 1345℃ 0条
goland 正则爬取手机号

goland 正则爬取手机号

package main import ( "fmt" "io/ioutil" "net/http" "os" "regexp" ) var ( rePhone = `(1[3456789]\d)(\d{4})(\d{4})` ) func HandleError(err error, when string) { if err != nil { fmt.Println(when, err) os...

Goland 2021-10-03 AM 1385℃ 0条
golang抓取网页并分析页面包含的链接

golang抓取网页并分析页面包含的链接

下载非标准的包,"golang.org/x/net/html"先安装git,使用git命令下载git clone https://github.com/golang/net将net包,放到GOROOT路径下比如:我的是:GOROOT = E:\go\所以最终目录是:E:\go\src\golang.org\x\net注意:如果没有golang.org和x文件夹,就创建创建fetch目录,在其下创建main.go文件,main.go文件代码内容如下:package mainimport ( "os" "net/http" "fmt&q...

Goland 2021-10-03 AM 1943℃ 0条
PHP IP地址归属地,支持IPv6地址(离线数据库,定期更新)

PHP IP地址归属地,支持IPv6地址(离线数据库,定期更新)

PHP IP地址归属地,支持IPv6地址(离线数据库,定期更新)为什么建立这个库政府在大力推进IPv6建设,作者响应国家号召,整合网络免费数据库,制作成离线版供大家使用国家公文链接:关于开展2019年IPv6网络就绪专项行动的通知使用方法安装composer require ritaswc/zx-ip-address直接使用$result = \Ritaswc\ZxIPAddress\IPv4Tool::query('114.114.114.114'); /* $result = [ "start" => "114.114.114.114&qu...

PHP 2021-10-01 PM 1982℃ 0条
封装PHP的curl请求 支持POST和GET

封装PHP的curl请求 支持POST和GET

方法function http($url, $method="GET", $postfields = '', $headers = [], $debug = false, $timeout=60) { $method = strtoupper($method); $ci = curl_init(); curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($ci, CURLOPT_USERAGENT, "Mozilla/5.0 (Wi...

PHP 2021-10-01 PM 1989℃ 0条
php 导入sql文件到数据库

php 导入sql文件到数据库

<?php /** * Created by PhpStorm. * User: Administrator * Date: 2018/10/13 * Time: 10:25 */ class ImportData{ //数据库信息 private $dbhost; private $dbuser; private $dbpw; private $dbport; private $dbname; private $dbcharset; private $link; private $tablepre;...

PHP 2021-10-01 PM 1841℃ 0条
php向数据库中导入.sql文件

php向数据库中导入.sql文件

<?php function insert($file,$database,$name,$root,$pwd)// { //将表导入数据库 header("Content-type: text/html; charset=utf-8"); $_sql = file_get_contents($file);//写自己的.sql文件 $_arr = explode(';', $_sql); $_mysqli = new mysqli($name,$root,$pwd,$d...

PHP 2021-10-01 PM 2068℃ 0条
php 取汉字所有拼音,取第一个字拼音

php 取汉字所有拼音,取第一个字拼音

<?php /* include _include(APP_PATH . 'model/chinese_spell.func.php'); $str = '取汉字所有拼音'; // 取全部拼音 echo get_full_spell($str); echo '<hr>'; // 取第一个字拼音 echo get_first_spell($str); * */ // 取全部拼音 function get_full_spell($str) { $chinese_spell = new chinese_spell(); $str = code_convers...

PHP 2021-09-27 PM 1646℃ 0条
php 常用函数库收藏

php 常用函数库收藏

<?php // hook model_check_start.php function is_word($s) { // hook model_is_word_start.php $r = preg_match('#^\\w{1,32}$#', $s, $m); // hook model_is_word_end.php return $r; } function is_mobile($mobile, &$err) { // hook model_is_mobile_start.php if(!preg_match('...

PHP 2021-09-27 PM 1543℃ 0条