calmchess Posted May 31, 2010 Share Posted May 31, 2010 Why doesn't this counter count? $oneTime=0; foreach ($arr0 as $value2) { echo $oneTime++; } 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. 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. Link to comment https://forums.phpfreaks.com/topic/203395-foreach-counter/#findComment-1065526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.