Log in

View Full Version : Resolved Losing Value of Variable



bluewalrus
11-07-2010, 11:26 PM
Line 1 here displays the correct file names, at line 7 the values are lost, the count is correct though. Does anyone know why this would occur?


echo $file2;
if (!isset($n)) {
$n = 0;
} else {
$n = count($helmets);
}
echo $files2 . $n;
$helmets[$n] = $files2;

Nile
11-07-2010, 11:32 PM
Take a look:


echo $file2;
if (!isset($n)) {
$n = 0;
} else {
$n = count($helmets);
}
echo $files2 . $n;
$helmets[$n] = $files2;

;)

bluewalrus
11-08-2010, 12:07 AM
OO hah thanks. I thought I was missing something simple there.

Nile
11-08-2010, 12:13 AM
No problem! It's the simplest mistakes that make you wonder the most. Please set the status of this thread to "Resolved"