Quantcast
Channel: Magp.ie » array
Browsing all 3 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Convert CSV data into an associative array

If you want to convert comma separated values into an associated array, then use the following code. Note: The code uses the first row of your CSV data to determine the keys in the associative array....

View Article



Image may be NSFW.
Clik here to view.

Find duplicates in an array with PHP

Here is a function to find duplicate items in an array. /** * Takes an array and returns an array of duplicate items */ function get_duplicates( $array ) { return array_unique( array_diff_assoc(...

View Article

Image may be NSFW.
Clik here to view.

Parse Print_r output and convert into CSV

These days I seem to looking a lot a print_r output. For the uninitiated, print_r is a handy PHP function to allow you to print the contents of an array in a neat, readable format. When I create a PHP...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images