Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged array



Ordena cualquier array multidimensional en base a un campo específico
0 744 posted 12 years ago by n19ht
ISO 3166-1 alpha-2 php array
0 651 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 956 posted 12 years ago by Rain
Takes the collection 'david' and gives a unique array of the keys used.
0 745 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 945 posted 12 years ago by lemcoe9
Esta función permite transformar un objeto a un array.
0 558 posted 12 years ago by n19ht
Function to import array of php data to pod table
0 663 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 732 posted 12 years ago by liamchapman
0 639 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 454 posted 13 years ago by mrgurner
1 837 posted 13 years ago by frederichoule
0 730 posted 13 years ago by mike_fowler
0 1139 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 922 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 513 posted 13 years ago by f6design
Removes 'false', '0', 'null' or '' from the array
0 761 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 555 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 585 posted 13 years ago by mloberg
Different formats for listing states.
0 769 posted 13 years ago by MikeNGarrett
6 727 posted 13 years ago by Roaa
This code comes from the php documentation (see url)
0 573 posted 13 years ago by jli
2 1600 posted 13 years ago by krillzip
0 677 posted 13 years ago by takel