fork download
  1. <?php
  2. function getBirthDate($input){
  3. $x=explode("/",$input);
  4. $i=3
  5.  
  6. $days=8;
  7. $months=2;
  8.  
  9. $isbirthday=false;
  10. if(($days==$x[$i-2]) && ($months==$x[$i-3])){
  11. $isbirthday=true;
  12. }
  13.  
  14. if($isbirthday==true){
  15. echo "Today is the birthday. \n";
  16. $years=(2012-($x[$i-1]));
  17. }
  18. else{
  19. echo "Today is not the birthday. \n";
  20. $years=(2012-($x[$i-1]))-1;
  21. }
  22.  
  23. $totaldays = ($years * 365);
  24.  
  25. if($months>=1){
  26. $totaldays+=31;
  27. }
  28. if($months>=2){
  29. $totaldays+=29;
  30. }
  31. if($months>=3){
  32. $totaldays+=31;
  33. }
  34. if($months>=4){
  35. $totaldays+=30;
  36. }
  37. if($months>=5){
  38. $totaldays+=31;
  39. }
  40. if($months>=6){
  41. $totaldays+=30;
  42. }
  43. if($months>=7){
  44. $totaldays+=31;
  45. }
  46. if($months>=8){
  47. $totaldays+=31;
  48. }
  49. if($months>=9){
  50. $totaldays+=30;
  51. }
  52. if($months>=10){
  53. $totaldays+=31;
  54. }
  55. if($months>=11){
  56. $totaldays+=30;
  57. }
  58. if($months>=12){
  59. $totaldays+=31;
  60. }
  61. $totaldays+=$days;
  62. $totalyears=intval($totaldays/365);
  63.  
  64.  
  65. $returnarray=array($totalyears, $isbirthday);
  66. return $returnarray;
  67. }
  68. ?>
Runtime error #stdin #stdout 0.02s 13664KB
stdin
Standard input is empty
stdout
Parse error: syntax error, unexpected T_VARIABLE in /home/1jtenV/prog.php on line 6