Hmm, have you seen sprintf or does this serve a different purpose? This could be great if the function took, say, a callback function that could be used to validate fields that were passed to it.
ShawnCplus
Code Monkey
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
I use sprintf occasionally. I just liked throwing a ? wherever I need something. Not saying %s is hard or anything. I don't need to worry about data type conversion because I handle that in my code.
Also it allows for using the same data more than once. If I use :user-name more than once in a string, all the placeholders will be replaced. With sprintf I would have to add the username as a param twice.
The callback is a great idea, but I have no idea how I would integrate it. As of right now, I don't see a way of adding it and not overcomplicating the function.
kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194