Tag Archives: array

Transform a csv file to associative array in PHP

csv

 Transform a csv file to associative array in PHP There are a lot of  examples on how to take a CSV file and put it in an array, but the main problem about them is that the header and the rest of the content from the csv are placed on separate keys, both on the

How to sort a multidimensional array based on key?

snippets

How to sort a multidimensional array based on key? First of all, let’s give credit to the person who wrote this function. The problem ? Let’s say you have a multidimensional array and you want to sort based on a key that is not on the first level of the array, how would you do

How to get last key in an array in PHP

snippets

How to get last key in an array in PHP? Arrays can have lots of elements, some that may not be needed at one point. Let’s say that we need in some cases the last key or last element of an array in PHP, what would you do? A very good solution and clever practice

How to parse an array in php

How to parse an array in php I remember back when I first started programming that I was having a bit of hard time when parsing an array in any giving language (well only php or java at the time), its always like that, after you learn it, you always think its very simple. Well

Request an article ←