Archive for May 2019

Php check if English date time format correct

if(preg_match(’/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/’,$datetime)) { echo "correct"; }

Does PHP have a virtual machine like Java?

Yes. Independently from the platform PHP is running on, the scripts are compiled into the same bytecode and run by the Zend Engine. The difference from Java is that this compiled code is usually not stored into separate files and the scripts are re-compiled on each execution (however, see opcode caches). Another important difference between […]

If github shows wrong language icon

1. Create .gitattributes in repo’s main directory 2. Add the following line to it *.css linguist-language=PHP 3. Change css extension to right extension that causes the problem, for example to *.twig