PHP & MySQL | Tutorials

David Carr

Reading markdown files with parsedown

Read me files on GitHub are written in Markdown, I wanted to be able to grab the contents of a file and use it as HTML. This is where Parsedown comes in.

Parsedown is a Markdown parser for PHP, once included converting Markdown to html is as simple as passing the html to it’s text function:

$html = file_get_contents('');
$Parsedown = new Parsedown();
echo $Parsedown->text($html);

That’s it! nice and simple.

For more information on using Parsedown with PHP see this video:

Domains are often purchased from multiple providers, keeping track of where a domain is and its DNS settings can be tricky. Domain Mapper solves this by listing all your domains in one place. View your DNS settings and receive reminders to renew your domains. Try it today.

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.