PHP Parse error: syntax error, unexpected T_PUBLIC
You can remove public keyword from your functions, because, you have to define a class in order to declare public, private or protected function
The public
keyword is used only when declaring a class method.
Since you're declaring a simple function and not a class you need to remove public
from your code.