Hence switch foreach to for loop
# First, do some preliminary work. This may shift some apostrophes from
# being mark-up to being text. It also counts the number of occurrences
# of bold and italics mark-ups.
- $i = 0;
$numbold = 0;
$numitalics = 0;
- foreach ( $arr as $r ) {
+ for ( $i = 0; $i < count( $arr ); $i++ ) {
if ( ( $i % 2 ) == 1 ) {
# If there are ever four apostrophes, assume the first is supposed to
# be text, and the remaining three constitute mark-up for bold text.
$numbold++;
}
}
- $i++;
}
# If there is an odd number of both bold and italics, it is likely