Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

Reading markdown files with parsedown

David Carr

Tutorials PHP & MySQL

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:

<iframe frameborder="0" height="480" src="" width="853"></iframe>

Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!


My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.