Skip to content
Magp.ie

Tag: array

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. Continue reading “Parse Print_r output and convert into CSV” →

53.734750 -8.989992
Eoin Code 1 Comment February 22, 2013February 22, 2013

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( $array, array_unique( $array ) ) );
}
53.734750 -8.989992
Eoin Code 7 Comments February 2, 2011February 2, 2011

Convert CSV data into an associative array

If you want to convert comma separated values into an associated array, then use the following code.
Continue reading “Convert CSV data into an associative array” →

53.734750 -8.989992
Eoin Code 4 Comments January 28, 2011January 28, 2011

Tags

array associative array bash cheat sheet coda command commands cross-browser CSV cURL debug debugging techniques developer debug tool duplicates encoding ExternalInterface filters Flash format github Gmail javascript jQuery linux LSO Mac OSX MySQL online tools php plugin Port forwarding PuTTY regex regular expression screen scripting search shortcuts SSH Sublime Text SVN terminal textwrangler tips UTF8 validate email validate url wordpress WordPress coding standards XML

Join 1,131 other subscribers
Blog at WordPress.com.
  • Follow Following
    • magp.ie
    • Join 624 other followers
    • Already have a WordPress.com account? Log in now.
    • magp.ie
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar