php的源码怎么查看,php 查看页面源代码的实现代码(图文)
代码:
/**
* 显示与查看网页源代码
* edit:
*/
// Page title
$pagetitle = 'Baumeister Mediasoft Engineering :: Resourc
本节分享的这段php代码,可用于显示与查看网页的源代码。 代码: /** * 显示与查看网页源代码 * edit: */ // Page title $pagetitle = 'Baumeister Mediasoft Engineering :: Resources :: ' .'PHP Application: Display/View Web Page Contents/Source' ; // Messages $fmturl = ' "%s" contents/source: '."\n"; $nosource = '* empty / not found *'; // Form parameters $url = isset($_REQUEST['url']) ? $_REQUEST['url'] : ''; $dowrap = isset($_REQUEST['wrapsource']) && !empty($_REQUEST['wrapsource']) && ($_REQUEST['wrapsource'] == 'on') ? 1 : 0; URL name="url" value="" /> name="wrapsource" />Wrap if (!empty($url)) { // Start web page output echo ' '."\n"; // Display selected URL echo sprintf($fmturl, $url); // Enable URL-aware fopen wrappers to allow for URL file reading if ((double)phpversion() >= 4.2) { ini_set('allow_url_fopen', '1'); } // Read file $s = @file_get_contents($url); if (empty($s)) { // Web page empty/access failure echo $nosource; } else { // Display web page contents/source using form/textarea wrap=""> } } (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |