Skip to content

Instantly share code, notes, and snippets.

@kafene
Created January 25, 2013 12:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kafene/4634182 to your computer and use it in GitHub Desktop.
Save kafene/4634182 to your computer and use it in GitHub Desktop.
<?php
function github_markdown($text) {
$ch = curl_init('https://api.github.com/markdown/raw');
curl_setopt_array($ch, array(
\CURLOPT_POST => true
, \CURLOPT_RETURNTRANSFER => true
, \CURLOPT_POSTFIELDS => $text
, \CURLOPT_SSL_VERIFYPEER => false
, CURLOPT_HTTPHEADER => array('Content-Type: text/plain')));
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment