posts about optimizationIt's time to continue with my attempts to find which is the better (most optimized) way to program in PHP. In previous post I took a look at string concatenating. This time I'm going to iterate over arrays. The main goal is to get the key and the value of each item in an array. Let's start: Iterate over arrays test: This is the target array $values = array("a", "b", "c", "d", "e", "f"); and these are my test cases Case 1: foreach($values as $k=>$v){ } Case 2: for($k = 0; $k < sizeof($values); $k++){ $v = $values[$k]; } Case 3: $count = ... Hi, this is the first post from the series I'm starting about how to optimize your PHP code. I'll focus mainly on code comparisons so you can see which is the fastest way to do something in PHP. You are welcome to comment on tests that I'll do, suggest tests that are interesting to you and ask questions. I'm sure you'll find a satisfying answers by me or the community. The idea is to post a chapter every week, but I'm sure you'll get one even early. So let's start with today's tests: Concatenating strings test: This are some of the most popular ways to concatenate strings. So let's test them and see which is the ... | popular tags | |||