I got the snippet to run depending on the value of the param I passed to it, am calling the snippet multiple times on a page so I wrapped the functions inside
if (!function_exists(functionName)), (don’t know what exctly that does, but it’s working

)
For some reason if I put the functions below the switch statement I get an error message saying "function not found",

, but if I put the functions before the switch statement the code in the snippet runs fine.
Do functions always have to go before the switch statement or is it something to do with
if (!function_exists(functionName)) ?
Code in template:
[!mySnippetWithMultipleFunctions? &runFunction=`sample`!]
<?php
if (!function_exists(myFunctionOne))
{
function myFunctionOne()
{
echo "My Function <strong>One</strong> has run." . "<br />\n";
}
}
if (!function_exists(myFunctionTwo))
{
function myFunctionTwo()
{
echo "My Function <strong>Two</strong> has run." . "<br />\n";
}
}
switch($runFunction)
{
case "sample":
myFunctionOne();
break;
case "anotherSample":
myFunctionTwo();
break;
default:
echo "Default";
break;
}
?>
Is this the normal way to call a specific function inside a snippet that contains multiple functions, or is there a way to directly call the functions from the template/chunk?
Thanks for the help