|
Posted by ZeldorBlat on 09/08/05 00:44
Ahh, *those* curly brackets are a little different. prepareSQL() is
not a built in PHP function, so I can't say for sure what it does.
Based on your example, I would guess that it does something like
substitute the values passed as the second parameter (the array) into
the string passed as the first parameter ($sqlQuery) where the
parameters in the original string are refered to by {i} where i is
their index in the array.
I'd also venture a guess that your "return preg_replace..." code comes
from prepareSQL(). Without seeing the rest of the function, it looks
like that call preg_replace() is what does the actual replacement of
the variables.
So, in short, those {1}, {2}, etc. are *not* the same as the curly
braces described at http://www.php.net/strings
Navigation:
[Reply to this message]
|