By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

$("var" . $i) ?

P: n/a
Hi All,

Please some help about building a var name:

for($i=1;$i<5;$i++) {
$query=$("var" . $i);
//$var1
//$var2
//$var3
//$var4
}

Thank you in advance!

Jan

--


'I worry about my child and the Internet all the time, even though she's
too young to have logged on yet. Here's what I worry about. I worry that
10 or 15 years from now, she will come to me and say 'Daddy, where were
you when they took freedom of the press away from the Internet?'
--
--Mike Godwin, Electronic Frontier Foundation <http://www.eff.org/br/>
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Sat, 17 Apr 2004 20:30:28 +0200, Jan Rasche wrote:
Hi All,

Please some help about building a var name:

for($i=1;$i<5;$i++) {
$query=$("var" . $i);
//$var1
//$var2
//$var3
//$var4
}

for ($i=1; $i<5; $i++) {
$a = "var$i";
$query=$$a;
}

Regards,
Henk Burgstra
Jul 17 '05 #2

P: n/a
Henk Burgstra wrote:


for ($i=1; $i<5; $i++) {
$a = "var$i";
$query=$$a;
}


Hi Henk,

Thats it - thank you!

Regards, Jan


'They understood that the future would be built on the free exchange of
information; decentralisation; enriching the world's knowledge of
computing by increasing accessibility.'
--Steven Levy, Hackers. Heroes of the Computer Revolution.
Jul 17 '05 #3

P: n/a
Jan Rasche wrote:
Hi All,

Please some help about building a var name:

for($i=1;$i<5;$i++) {
$query=$("var" . $i);
//$var1
//$var2
//$var3
//$var4
}


Either the solution provided by Henk or this:

for($i=1;$i<5;$i++) {
$query=${"var" . $i};
}

--
MVH Jeppe Uhd - NX http://nx.dk
Webhosting for nÝrder og andet godtfolk
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.