PHP port of Markup.js