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!
Hi, I have one function which can accept an arbitrary number of variables. I want to pass all of these variables to another function. I have written the following script to do this.
Does anyone have a way of doing this without using the eval() construct? This method will get called frequently, and it would be far more efficient to not use eval(). Also, I have heard the quotation "if eval is the answer then you are probably asking the wrong question", so I feel like I should be doing all I can to avoid using it!
Jonah Bron wrote:Change addClosedTag() to accept an array of arguments.
Yeah, it seems like I'm going to have to do that. I was ideally after a solution which didn't require addClosedTag() to be changed, but I have pretty much concluded that it is impossible to do this with PHP. If anyone can do so, I'd love to be proved wrong!