PHP正则表达式获取字符串之间的内容

PHP正则表达式获取字符串之间的内容

$url = @$_GET["url"]; $info=@file_get_contents($url); preg_match('/<title>(.*?)<\/title>/',$info,$title); echo $title;

PHP 2021-10-04 AM 73℃ 0条
php 获取SSL 证书信息5

php 获取SSL 证书信息5

<?php $url = "http://www.baidu.com"; /** * Takes a domain name and returns SSL certificate information * * @param string $domain_name * @return array $certinfo */ function getSSL($domain_name) { $errno = 0; $errstr = ''; // Set socket connection timeout $t...

PHP 2021-10-03 PM 87℃ 0条
PHP 获取SSL 证书信息4

PHP 获取SSL 证书信息4

<?php $url = "http://www.baidu.com"; $orignal_parse = parse_url($url, PHP_URL_HOST); $get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE))); $read = stream_socket_client("ssl://".$orignal_parse.":443", $errno, $e...

PHP 2021-10-03 PM 86℃ 0条
PHP 获取SSL证书信息3

PHP 获取SSL证书信息3

<?phpif($fp = tmpfile()){$ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.baidu.com/"); curl_setopt($ch, CURLOPT_STDERR, $fp); curl_setopt($ch, CURLOPT_CERTINFO, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY...

PHP 2021-10-03 PM 127℃ 0条
php 获取 SSL 信息

php 获取 SSL 信息

class SSL { public $domain, $validFrom, $validTo, $issuer, $validity, $validitytot, $crtValRemaining; private static function instantiate($url, $info) { $obj = new static; $obj->domain = $url; $obj->validFrom = $info['validFrom']; $obj->validTo =...

PHP 2021-10-03 PM 108℃ 0条
PHP获取域名ssl信息

PHP获取域名ssl信息

<?php //查询入口 function testOp($domain){ $cert_info = get_cert_info($domain); $dn = $cert_info['subject']['CN']; //证书保护域名 $validFrom_time_t = date('Y-m-d H:i:s', $cert_info['validFrom_time_t']); //证书开始时间 $validTo_time_d = date('Y-m-d H:i:s', $cert_info['validT...

PHP 2021-10-03 PM 115℃ 0条
php 由ttf字体文件生成png预览图

php 由ttf字体文件生成png预览图

php 由ttf字体文件生成png预览图<?php /** * Created by graph-design-api. * AUTHOR: daiguojin * Date: 2020/9/16 9:40 */ //header("Content-type: image/png"); // The text to draw $text = 'ABeeZee'; // Replace path by your own font path $fontFile = 'ABeeZee.ttf'; $fontSize = 24; $pos = image...

PHP 2021-10-03 PM 111℃ 0条
PHP 手机号中间4位加密

PHP 手机号中间4位加密

/**中间加密 字符串截取法*/public static function encryptTel($tel) {$new_tel = substr($tel, 0, 3).'****'.substr($tel, 7); return $new_tel;} /**中间加密 替换字符串的子串*/public static function encryptTel($tel) {$new_tel = substr_replace($tel, '****', 3, 4); return $new_tel;} /**中间加密 用正则*/public stat...

PHP 2021-10-03 PM 96℃ 0条
php获取上个星期的日期

php获取上个星期的日期

<?php $ts = time(); $last_monday = last_monday($ts); // echo date('Y-m-d H:i:s', $last_monday); echo "上个星期一:".date('Y-m-d', $last_monday); echo "<br>"; $last_xinqitian = last_xinqitian($ts); echo "上个星期天:".date('Y-m-d', $last_xinqitian); //上周一 // @$timestam...

PHP 2021-10-03 PM 73℃ 0条
PHP简单的Curl的Get请求和Curl的Post请求和file_get_contents的Get请求获取接口JSON数据

PHP简单的Curl的Get请求和Curl的Post请求和file_get_contents的Get请求获取接口JSON数据

PHP携带Cookie用Curl进行Post或Get请求获取数据PHP全能Curl请求/** * curl发送HTTP请求方法 * @param $url * @param string $method * @param array $params * @param array $header * @param int $timeout * @param bool|false $multi * @return mixed * @throws Exception */ function hansCurl( $url, $method = 'GET', $params =...

PHP 2021-10-03 PM 52℃ 0条
PHP常用函数总结

PHP常用函数总结

码代码时容易用到的基础函数总结。上代码//PHP设置跨域header("Access-Control-Allow-Origin:*");//PHP设置JSON头 以JSON格式输出header("Content-type:application/json; charset=utf-8");//正则取字符串preg_match_all('/字符串(.*?)字符串/i',$data,$out);// PHP把JSON对象转字符串不转码输出json_encode($results, JSON_UNESCAPED_UNICODE);//PHP设置最大运行时间 0 是永久set_time_limi...

PHP 2021-10-03 PM 45℃ 0条