Eapen G's Library tagged → View Popular
Mike Davidson – Make Your Site Mobile-Friendly in Two Minutes
php_value auto_prepend_file /localfilepath/global_prepend.php
php_value auto_append_file /localfilepath/global_append.php
<?php
function callback($buffer) {
if ($_SERVER['SERVER_NAME'] == 'mobile.myawesomeblog.com') {
$buffer = str_replace('http://www.myawesomeblog.com', 'http://mobile.myawesomeblog.com', $buffer);
$buffer = preg_replace('/[\n\r\t]+/', '', $buffer);
$buffer = preg_replace('/\s{2,}/', ' ', $buffer);<br />
$buffer = preg_replace('/(<a[^>]*>)(<img[^>]+alt=")([^"]*)("[^>]*>)(<\/a>)/i', '$1$3$5<br />', $buffer);
$buffer = preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/i', '', $buffer);
$buffer = preg_replace('/<\/head>/i', '<meta name="robots" content="noindex, nofollow"></head>', $buffer);
}
return $buffer;
}
ob_start("callback");
?>
<?php ob_end_flush();?>
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in webdevel...
-
WebDevelopment
This list consist of all ge...
Items: 17 | Visits: 3
Created by: Russell Ramey
-
webdevelopment
Links to webdevelopment
Items: 252 | Visits: 188
Created by: alfred westerveld
-
Webdevelopment
Items: 5 | Visits: 4
Created by: Ava Chen
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
