WebP is becoming the new web standard regarding photos on the web today. PHP 7+ makes things really easy for you
I am using CodeIgniter 3. In order to publish code using the pre tag I had to translate line breaks and tabs when editing my posts. This is what I came up with