Skip to content

Instantly share code, notes, and snippets.

@benklocek
Created May 30, 2011 20:11
Regex for fixing absolute URL includes
$pattern = '<\?(\s?include\("?)(http:\/\/www\.domain\.com)(.*?\.php)(.*\n?)';
$subject = "<?php include($_SERVER['DOCUMENT_ROOT'] . '$3';) ?>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment