Optimizing Web server Response

Analyze the below given snippet and choose the most optimized version that executes the similar functionality.

for( $i=0; i< count($arrB); $i++){

echo count($arrB);

}

Options

1.for( $i=0; i< $len; $i++){

$len = count($arrB);

echo $len;

}

2.$len = count($arrB);

for( $i=0; i< $len; $i++){

echo $len;

}

3.While( $i< $len){

$len = count($arrB);

echo $len;

$i++;

}

4.for( $i=0; i< $len; $i++){

$len = count($arrB);

}

echo $len;

}

Related Posts

Close Bitnami banner
Bitnami