You are here: Re: explanation please « PHP Programming Language « IT news, forums, messages
Re: explanation please

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация