php - Function showing error when trying to call -


i beginner php developer , little bit of help. trying create function , have copied code tutorial. below code:

<?php  function date(); {     echo date("f j, y, g:i a"); } date(); ?> 

now tutorial goes should getting following output:

march 10, 2001, 5:16 pm 

but getting error of:

parse error: syntax error, unexpected ';', expecting '{' in [path file] 

i not sure error or doing wrong. please can help.

thanks,

ross.

edit 1:

changed code per advice. renames date() showdate() , works fine now. all.

<?php       function showdate()     {         echo (date("f d, y"));      }      showdate();   ?> 

first of have syntax error added semicolon after function date()

secondly should not use php in built function function name. date() php in built function.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -