Skip to content

Instantly share code, notes, and snippets.

Created August 28, 2011 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1177175 to your computer and use it in GitHub Desktop.
Save anonymous/1177175 to your computer and use it in GitHub Desktop.
if (preg_match("/^http\:\/\/(www\.)?pastebin\.com\/(.*)/i", $url, $regs)) {
$val = $regs[2];
$html = join("", file($url));
$html = substr($html, strpos($html, '<div id="code_frame">'), strlen($html));
$html = substr($html, 0, strpos($html, '<div class="content_title">'));
$html = trim($html);
$code_ae = "<div class='oembed-container oembed-code'>$html</div>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment