- as $current never changes there will only be one match, when $i is 1
not sure if this helps clear things up.
<?php
$page = 8;
$current = 1;
for($i = 1 ; $i<=$page ; $i++){
if($current==$i){
echo '*'.$i.',';
}else{
echo $i.',';
}
}
//*1,2,3,4,5,6,7,8,
//change current to 6
//1,2,3,4,5,*6,7,8,
?>