Array and memory | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Array and memory

why an array doesn't keep the values when added in a for loop?

17th Jun 2017, 5:10 PM
Edson
Edson - avatar
1 Answer
+ 2
I haven't used php before but the most likely reason is that it's an issue with scope. if you're passing something to a function then it's important to consider if you're passing the memory address or just a duplicate. if you can show us the section of your code where the addition is happening then it'll make it much easier for someone knowledgeable about php to help you.
20th Jun 2017, 2:29 AM
Christian
Christian - avatar