3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $timeString=' <script language="javascript"> var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10) { dd="0"+dd } if(mm<10) { mm="0"+mm } today = mm+"/"+dd+"/"+yyyy + " " +today.getHours() + ":" + today.getMinutes()+":" + today.getSeconds(); document.write(today); </script> '; echo "INSERT INTO `apply` VALUES ('test', '1', '$timeString') ";
Output for 4.3.0 - 7.1.0
INSERT INTO `apply` VALUES ('test', '1', ' <script language="javascript"> var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10) { dd="0"+dd } if(mm<10) { mm="0"+mm } today = mm+"/"+dd+"/"+yyyy + " " +today.getHours() + ":" + today.getMinutes()+":" + today.getSeconds(); document.write(today); </script> ')