How do you add to a variable that is inside a foreach loop? Everything I try hasnt worked.
rysin
0
Light Poster
Recommended Answers
Jump to PostHey There,
Are you having problems modifying a variable you declare outside of the loop?
This code will increment the variable in the foreach loop and change it's value outside the loop.
Let me know if I'm misunderstanding you :)
Best Wishes,
Mike
All 4 Replies
eggi
92
Posting Whiz
katharnakh
7
Posting Whiz in Training
KevinADC
192
Practically a Posting Shark
rysin
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.