How to concatenate PHP variable name?
You should use ${'varname'} syntax:
for ($counter=0,$counter<=67,$counter++){
echo $counter;
${'check' . $counter} ="some value";
}
this will work, but why not just use an array?
$check[$counter] = "some value";
The proper syntax for variable variables is:
${"check" . $counter} = "some value";
However, I highly discourage this. What you're trying to accomplish can most likely be solved more elegantly by using arrays. Example usage:
// Setting values
$check = array();
for ($counter = 0; $counter <= 67; $counter++){
echo $counter;
$check[] = "some value";
}
// Iterating through the values
foreach($check as $value) {
echo $value;
}