comparison info.php @ 11:2808bc76a2fa

Rename a variable.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 04 Jan 2016 10:47:50 +0200
parents 8780755f38a1
children 6523f431e731
comparison
equal deleted inserted replaced
10:8780755f38a1 11:2808bc76a2fa
375 } 375 }
376 376
377 // Swap desired rows 377 // Swap desired rows
378 if (count($setSwapRows) > 0) 378 if (count($setSwapRows) > 0)
379 { 379 {
380 $str = []; 380 $swapped = [];
381 $nkeys = count($currTable); 381 $nkeys = count($currTable);
382 foreach ($setSwapRows as $from => $to) 382 foreach ($setSwapRows as $from => $to)
383 if ($from >= 0 && $from < $nkeys && $to >= 0 && $to < $nkeys && $to != $from) 383 if ($from >= 0 && $from < $nkeys && $to >= 0 && $to < $nkeys && $to != $from)
384 { 384 {
385 $str[] = $from." &lt;=&gt; ".$to; 385 $swapped[] = $from." &lt;=&gt; ".$to;
386 386
387 $tmp = $currTable[$from]; 387 $tmp = $currTable[$from];
388 $currTable[$from] = $currTable[$to]; 388 $currTable[$from] = $currTable[$to];
389 $currTable[$to] = $tmp; 389 $currTable[$to] = $tmp;
390 } 390 }
391 391
392 if (count($str) > 0) 392 if (count($swapped) > 0)
393 { 393 {
394 echo "<p>Swapped rows: ".implode(", ", $str)."</p>\n"; 394 echo "<p>Swapped rows: ".implode(", ", $swapped)."</p>\n";
395 } 395 }
396 } 396 }
397 397
398 // Print out the table 398 // Print out the table
399 stPrintAlloyTable("alloyTable", $currTable, $currTable, TRUE); 399 stPrintAlloyTable("alloyTable", $currTable, $currTable, TRUE);