PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
functions in PHP don't have access to the global scope. $cycle is defined in the global scope but is not defined in the function scope. Either make it a global variable (though you probably shouldn't if you're not aware of the implications), pass it into the function or declare it inside the function.
If you want to reuse the $cycle array between several functions, consider using a class
Perfect, thank you. I do plan on using it in classes eventually, but right now I'm just writing out some concept code to make sure I know what I'm doing.
Anyway - problem solved by moving it into the function!
He just showed partial code. Without that closing brace, he would have received a fatal error and never would've seen that warning he gave in his first post.
By the way, I edited your post to add [ syntax] tags. Please use those in the future