生成的静态页 怎么把里面PHP地址改成html地址
Jun 23, 2016 pm 02:03 PM define('CACHE_FILE', '111.html');function callback($buffer) { file_put_contents(CACHE_FILE, $buffer, FILE_APPEND); return $buffer; //不需显示页面内容就 return '';}file_put_contents(CACHE_FILE, '');ob_start("callback", PHP_OUTPUT_HANDLER_START);
jingtai.php
'; ?>
先只生成了
jingtai.html
怎么把123.php改成123.html呢
回复讨论(解决方案)
你在
file_put_contents('111.html', $buffer);
前先执行
$buffer = preg_replace('/(href=.+?)\.php/', '$1.html', $buffer);
不过规则可能没那么简单,你想好了再说

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

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

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon

Announcement of 2025 PHP Situation Survey
