Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nArr = array("key1" => "val1", "key2" => "val2");
- $count = 0;
- foreach ( $nArr as $key => $singleValue ) {
- // do something with the value/key
- $count++; // add 1 to the count every time we go trough one loop
- }
- echo $count; // "2"
Advertisement
Add Comment
Please, Sign In to add comment