Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arrays in PHP
#1
I've just been learning a little about arrays in PHP and am wandering what method of printing an array with different indices is better, using a foreach loop or using each with a while loop. Any ideas?
Reply
#2
I would use a for loop for numerical indices, and a for-each for associative arrays.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)