新浪星座API免费开放星座运势 12生肖工作 爱情 理财 健康 商谈 风水学 速配
新浪星座API免费开放星座运势 12生肖工作 爱情 理财 健康 商谈 风水学 速配
$astroDir = './'; $astroArray = array ( '白羊座' => array('aries', '03/21-04/19'), '金牛座' => array('taurus', '04/20-05/20'), '双子座' => array('gemini', '05/21-06/21'), '巨蟹座' => array('cancer', '06/22-07/22'), '狮子座' => array('leo', '07/23-08/22'), '处女座' => array('virgo', '08/23-09/22'), '天秤座' => array('libra', '09/23-10/23'), '天蝎座' => array('scorpio', '10/24-11/22'), '射手座' => array('sagittarius', '11/23-12/21'), '魔羯座' => array('capricorn', '12/22-01/19'), '水瓶座' => array('aquarius', '01/20-02/18'), '双鱼座' => array('pisces', '02/19-03/20') ); function generateAstro(){ global $astroDir, $astroArray; $fileLog = $astroDir.'.log'; $log = is_file($fileLog) ? json_decode(file_get_contents($fileLog)) : false; if(!isset($log->latestTime) || $log->latestTime (.*?)<em>(.*?).*?有效日期:(.*?)综合运势(.*?)爱情运势(.*?)工作状况(.*?)理财投资(.*?)健康指数(.*?)商谈指数(.*?)幸运颜色(.*?)幸运数字(.*?)速配星座(.*?)<div class="lotconts">(.*?)/isu', curl('http://vip.astro.sina.com.cn/astro/view/'.$astro[0].'/day/', $astro[0]), $matches); file_put_contents($astroDir.$astro[0].'.dat', json_encode(array($matches[1], $matches[2], html2txt($matches[3]), substr_count($matches[4], '<img substr_count html2txt file_put_contents json_encode alt="新浪星座API免费开放星座运势 12生肖工作 爱情 理财 健康 商谈 风水学 速配" > html2txt($matches[3])))); unset($matches); } } function getAstroByDate($date){ global $astroArray; foreach ($astroArray as $k => $v){ $value = explode('-', $v[1]); if(date($value[0]) ]*?>.*?@si', // Strip out javascript '@]*?>@si', // Strip out HTML tags '@<style>]*?>.*?</style>@siU', // Strip style tags properly '@@', // Strip multi-line comments including CDATA '@\s+| @' ); $text = preg_replace($search, '', $document); return $text; } function curl($url, $type){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, 'http://astro.sina.com.cn/fate/astro_'.$type.'.html?prourl=0'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/'.mt_rand(2, 9).'.0 (Windows NT 6.1; WOW64; rv:'.mt_rand(10, 30).'.0) Gecko/'.mt_rand(2000, 2014).'0101 Firefox/'.mt_rand(10, 30).'.0'); curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); curl_close($ch); return $data; } function isBirthDate($date) { if (empty($date) || $date == '0000-00-00') return false; if (preg_match('/^([0-9]{4})-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[1-2][0-9])|(?:3[01]))([0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date)) { return ($birth_date[1].'-'.$birth_date[2].'-'.$birth_date[3] <p> </p> <p class="item-note"><br></p> </div></em>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.
