Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged array



Ordena cualquier array multidimensional en base a un campo específico
0 736 posted 12 years ago by n19ht
ISO 3166-1 alpha-2 php array
0 643 posted 12 years ago by freezy
Used to sort array of objects by it's property Note: Anonymous functions are available since PHP 5.3.0.
0 944 posted 12 years ago by Rain
Takes the collection 'david' and gives a unique array of the keys used.
0 731 posted 12 years ago by lemcoe9
There seems to be no easy way to insert a key and value at the beginning of an array, as array_unset does not allow you to specify a key. This is not a very efficient way to do it, but it works. Pretend the array is currently: array("a"=>"b", "c"...
0 937 posted 12 years ago by lemcoe9
Esta función permite transformar un objeto a un array.
0 550 posted 12 years ago by n19ht
Function to import array of php data to pod table
0 656 posted 12 years ago by stewartduffy
a more useful way of printing php arrays in a nice readable format and able to decode serialized and json_encoded strings.
0 721 posted 12 years ago by liamchapman
0 632 posted 12 years ago by nebojsac
3rd argument of 'add_action' function is priority, by default set to 10. This is a much simpler way of reorder posts exactly as you want them to appear.
1 451 posted 13 years ago by mrgurner
1 821 posted 13 years ago by frederichoule
0 724 posted 13 years ago by mike_fowler
0 1132 posted 13 years ago by Japan
# function *formatArrayForDisplay* ## parameters: * **array** a 1- or 2-dimensional array for output * **mode** accepts **human** or **PHP** * **human** displays using `<pre>` tags and print_r * **PHP** displays PHP styl...
1 913 posted 13 years ago by daveespionage
Re-indexes an array so that the array keys count up from zero. This is useful if you have previously removed some array nodes.
0 506 posted 13 years ago by f6design
Removes 'false', '0', 'null' or '' from the array
0 750 posted 13 years ago by f6design
converts array (which is reference) in format <code> array(0 => array('id' => 1, 'name' => 'orange'), 1 => array('id' => 3, 'name' => 'banana')); </code> to <code> array(1 => array('id' => 1, 'name' => 'orange'), 3 => array('id' => 3, 'n...
0 549 posted 13 years ago by slav123
This simply takes an array and coverts it to variables. E.g. If you had an array, $array = array("key" => "value"), after running this script, $key would be "value".
0 575 posted 13 years ago by mloberg
Different formats for listing states.
0 764 posted 13 years ago by MikeNGarrett
6 720 posted 13 years ago by Roaa
This code comes from the php documentation (see url)
0 566 posted 13 years ago by jli
2 1592 posted 13 years ago by krillzip
0 671 posted 13 years ago by takel