Skip to content
Advertisement

Tag: pointers

While loop with next() vs foreach

I was going through some third party code and I ran onto this snippet for going through an array. Since this is a respectful code base I’m wandering what is the secret behind the trouble of moving internal pointer versus using the good old foreach loop. Thanks for your input! Answer The difference is that you are explicitly stating you

In PHP, what happens in memory when we use mysql_query

I used to fetch large amount of data using mysql_query then iterating through the result one by one to process the data. Ex: Recently I looked at a few framework and realized that they fetched all data to an array in memory and returning the array. I would like to know the pros/cons of each method. It appears to me

Advertisement