calmchess Posted May 31, 2010 Share Posted May 31, 2010 Why doesn't this counter count? $oneTime=0; foreach ($arr0 as $value2) { echo $oneTime++; } Quote Link to comment https://forums.phpfreaks.com/topic/203395-foreach-counter/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 31, 2010 Share Posted May 31, 2010 It will work if $arr0 is an array AND that code is not inside of a HTML tag, such as a form element, that would hide the values in the source of the page. Quote Link to comment https://forums.phpfreaks.com/topic/203395-foreach-counter/#findComment-1065521 Share on other sites More sharing options...
calmchess Posted May 31, 2010 Author Share Posted May 31, 2010 it was some html stopping it .....thanks learned something. Quote Link to comment https://forums.phpfreaks.com/topic/203395-foreach-counter/#findComment-1065526 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.