I create websites, applications and e-commerce solutions at Unleashed Technologies. When I'm not solving tough problems for clients or working on open-source projects, you can find me speaking at conferences all around the world. In my free time, I also like to tinker with Arduino and home automation.
I recently came across this really helpful PHP trick:
You can cast a numeric string to either
float, depending on its contents, by simply adding
var_dump("1" + 0); // int(1) var_dump("1." + 0); // float(1) var_dump("1.0" + 0); // float(1) var_dump("1.5" + 0); // float(1.5)
That's much cleaner than trying to make a conditional cast yourself:
Markdown is one of the most popular markup languages on the web. Unfortunately, with no standard specification, every implementation works differently, producing varying results across different platforms. The CommonMark specification fixes this by providing an unambiguous syntax specification and a comprehensive suite of tests. In this session you'll learn about this standard and how to integrate the league/commonmark parser into their PHP applications. We'll also cover how to customize the library to implement new features like custom Markdown syntax or advanced renderers.