Is there a way in php that i can call a different sub or something like that? Or does the code have to go in order?

also, whats wrong with this line:
echo ("Name ", $Number - 1, " is $Name[$Number]</br>");
i know its the bolded words, but i dont know how to fix