02 - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of 02.php

  1.  
  2. <?php
  3. $target_days = mktime(0,0,0,12,31,2013);// modify the birth day 12/31/2013
  4. $today = time();
  5. $diff_days = ($target_days - $today);
  6. $days = (int)($diff_days/86400);
  7. print "Days till next birthday: $days days!"."\n";
  8. ?>
  9.  
File Description
  • 02
  • PHP Code
  • 25 Jan-2024
  • 224 Bytes
You can Share it: