Azu Posted April 5, 2007 Share Posted April 5, 2007 How can I make a half function half variable, so that, like, I set it to the PHP code I want it to use, and put in my code like a function, except that all of the variables stuff act like I am just putting in the code, so that I don't have to declare all of the variables as global and stuff like that? Please tell me how I can do this I'd really appreciate it Basically I just want to cut down on my code size so that I don't have to copy and paste the same piece of code over and over, instead of making it into a function which messes with the way variables work and stuff.. thanks! Link to comment https://forums.phpfreaks.com/topic/45798-half-a-function/ Share on other sites More sharing options...
MadTechie Posted April 5, 2007 Share Posted April 5, 2007 Erm.. Use either a class or call functions from within functions!! use & on variables to pass them around Basically I just want to cut down on my code size so that I don't have to copy and paste the same piece of code over and over, Link to comment https://forums.phpfreaks.com/topic/45798-half-a-function/#findComment-222483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.