sql - What is this loop using PHP $$ syntax doing? -


I found this PHP code in an app that I need to modify ...

  $ Link = mysql_query ($ querystring); Forex Currency (mysql_fetch_array ($ link) as the $ key = & gt; $ value) {$$ key = $ value; }  

I'm a little stumped.

Does this really repeat the query results and is copying the key in the value?

If so, what would that mean?

Besides, what is the double $$ notation? I have not seen it before in PHP and I can not find a reference on this PHP site. Is this a typo? This does not appear affecting the code; I do not want to go "fixing" anything like this without understanding the results.

$$ is not a typo; This is how you interact with a variable in the name of another variable. Like you do

  $ varname = 'foo'; $$ varnish = 'bar';  

You have just set the code <$> to $ foo .

What the loop is doing Expand row content in the current variable namespace, like it is a terrible way to do this, at least not because it is also running on numerical indices.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -