Kevin Kevin - 1 year ago 76
PHP Question

Multiple function tasks php

I have a question about a function using php.

Can i for example have a function with the same name do multiple things.


function name () {
echo "this";

function name () {
echo "that";


so the same function doing multiple tasks.

Answer Source

No, this is not possible, and will yield

Fatal error: Cannot redeclare name() (previously declared in ...) in php shell code on line ...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download