I found the the strengths of php functions is implementing the function is easy because you simply inject your function in the php tag in your document. Some of the weaknesses are that JavaScript seems a little more organized because there is more separation of html and JavaScript. Also with javascript if is very easy to interact with other html elements via JavaScript selectors.

To see the example visit http://erikalicea.esy.es/PhpTesting.php
Here is the code I used:

php