i am new to coding and can't establish idea for easy logic..
ok, I have written a code firstly have a look:
<?php
function month_ana($mna){
$c_mna = strlen($mna);
echo "Let's Analysis <b>$mna</b> <br> Total Charectars: $c_mna <br>";
}
$go[0] = "January";
$go[1] = "February";
$go[2] = "March";
$go[3] = "April";
$go[4] = "May";
$go[5] = "June";
$go[6] = "July";
$go[7] = "August";
$go[8] = "September";
$go[9] = "October";
$go[10] = "November";
$go[11] = "December";
$fo = "October";
$i = 0;
for($i=0;$i<=11;$i++){
if ($go[$i]==$fo){
break;
} else {
month_ana($go[$i]);
}
}
?>
what i wanna do is to delete the matched variable so, the function will skip it.
Let's see its output:
Let's Analysis January
Total Charectars: 7
Let's Analysis February
Total Charectars: 8
Let's Analysis March
Total Charectars: 5
Let's Analysis April
Total Charectars: 5
Let's Analysis May
Total Charectars: 3
Let's Analysis June
Total Charectars: 4
Let's Analysis July
Total Charectars: 4
Let's Analysis August
Total Charectars: 6
Let's Analysis September
Total Charectars: 9
but problem is i have used break();
statement so it stop working when variables matched in October
, but i wish that, this will skip the matched variable not stop here, so in this case it should skip October
and then start calculating again from November
and continue. I hope u understand the problem. Any ideas?
If you think you should refer me some articles then please do, because i am very keen to learn PHP programming. Thanks