Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged array



Ordena cualquier array multidimensional en base a un campo específico
0 1282 posted 13 years ago by n19ht
ISO 3166-1 alpha-2 php array
0 1097 posted 13 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 1512 posted 13 years ago by Rain
Takes the collection 'david' and gives a unique array of the keys used.
0 1312 posted 13 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 1642 posted 13 years ago by lemcoe9
Esta función permite transformar un objeto a un array.
0 1049 posted 14 years ago by n19ht
Function to import array of php data to pod table
0 1189 posted 14 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 1957 posted 14 years ago by liamchapman
0 1162 posted 14 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 945 posted 14 years ago by mrgurner
1 1529 posted 14 years ago by frederichoule
0 1308 posted 14 years ago by mike_fowler
0 1771 posted 14 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 1545 posted 14 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 993 posted 14 years ago by f6design
Removes 'false', '0', 'null' or '' from the array
0 1341 posted 14 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 1028 posted 14 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 1097 posted 14 years ago by mloberg
Different formats for listing states.
0 1281 posted 14 years ago by MikeNGarrett
6 1300 posted 14 years ago by Roaa
This code comes from the php documentation (see url)
0 1041 posted 14 years ago by jli
2 2336 posted 14 years ago by krillzip
0 1119 posted 14 years ago by takel