Skip to content

Instantly share code, notes, and snippets.

@benklocek
Created May 30, 2011 20:11
Show Gist options
  • Save benklocek/999402 to your computer and use it in GitHub Desktop.
Save benklocek/999402 to your computer and use it in GitHub Desktop.
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