Referencing sequentially numbered variables

From: Date: Sun, 07 Oct 2001 04:12:10 +0000
Subject: Referencing sequentially numbered variables
Groups: php.general 
Request: Send a blank email to php-general+get-70276@lists.php.net to get a copy of this message
I have 13 variables, col1-col13. Is there a way, other than making an array, to address these variables in a loop? In some languages you are allowed to reference these as if they were an array, i.e., col1 could be addressed as col[1]. This does not seem to be the case with PHP. What I would like to do, would be analagous to: for ($i=1;$1<14;$i++) { $header .= $col[$i]; } This does not work, but it demonstrates what I hope to be able to do. Is this possible?

« previous php.general (#70276) next »