Commit Graph

39 Commits

Author SHA1 Message Date
Andrey Hristov
a920f00479 New function added - array_intersect_assoc() similar to array_intersect()
but the keys are also used in the comparison. So the result is a subset of
the result of array_intersect().
Test will be committed too.
2002-09-21 14:50:04 +00:00
Andrey Hristov
afdfe38ef3 New function added : array_diff_assoc() . Like array_diff() but does
additional checks on key values. Test script will be added too.
#My first patch . it feels strange :)
2002-09-11 18:13:48 +00:00
Edin Kadribasic
333b01b041 Fixed ZTS build. 2002-09-10 22:36:43 +00:00
Andrei Zmievski
dd7cf22443 @- Fixed array_merge_recursive() to avoid problems with merging cyclical
@  arrays (bug #16064). (Andrei)
2002-09-10 18:34:16 +00:00
Andrei Zmievski
1668570e4d Changing email address. 2002-05-13 17:28:38 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Derick Rethans
78e4644fa1 - Renaming key_exists to array_key_exists
@- Renamed key_exists tp array_key_exists. (Derick)
#- Not sure if this belongs in NEWS, but it was already in a released
#  version. And yes, I know I'm breaking BC here, but as it was not documented
#  yet, that doesn't matter.
2001-11-11 18:28:43 +00:00
Andrei Zmievski
2890b57e46 @- Added array_chunk() function that splits an array into chunks of specified
@  size. (Andrei)
2001-10-27 05:11:15 +00:00
Rasmus Lerdorf
72fc6bc4b1 As suggested on php-dev, array_fill() is probably a better name for this
function.
2001-10-23 18:46:35 +00:00
Rasmus Lerdorf
798ec79319 Motivated by bug #13607 I wrote up a simple array_init() function that
lets you quickly create an array and initialize each element to a certain
value.
@ Add array_init() function (Rasmus)
2001-10-21 07:42:35 +00:00
Edin Kadribasic
e78b61542d Added array_change_key_case() function that returns array with
with all string keys lowercased or uppercased
@- Added array_change_key_case() function that returns array with
@  with all string keys lowercased or uppercased (EdinK)
2001-10-05 18:38:53 +00:00
Sterling Hughes
bcb426a207 Merge in qsort changes 2001-09-17 21:02:53 +00:00
Zeev Suraski
7b1c400631 More TSRMLS_FETCH annihilation (Zend compatibility patch) 2001-07-30 04:58:07 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
David Croft
34f03f2c5c @ - Added key_exists() to check if a given key or index exists in an
@ array or object (David Croft)
Added key_exists() to check if a given key or index exists in an array or object
2001-04-30 04:06:09 +00:00
Andrei Zmievski
d9aa966a44 @- Added array_map() function that applies a callback to the elements
@  of given arrays and returns the result. It can also be used with a
@  null callback to transpose arrays. (Andrei)
2001-03-19 21:20:02 +00:00
Andrei Zmievski
770c66125d @- Added array_filter(), which allows filtering of array elements via
@  the specified callback. (Andrei)
2001-03-16 20:46:33 +00:00
Andrei Zmievski
d73ef12429 @- Added array_reduce(), which allows iterative reduction of an array
@  to a single value via a callback function. (Andrei)
- Added array_reduce(), which allows iterative reduction of an array
  to a single value via a callback function.
- Fixed usage of zend_is_callable() in PCRE.
2001-03-12 03:06:53 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Andrei Zmievski
1424e36315 Rename to array_search(). 2001-02-20 14:23:03 +00:00
Jason Greene
1888a98a4b Moved the core of in_array into the function php_search_array, which is called by
in_array and search_array (new)

@ Added search_array which works similar to in_array but returns
@ the key instead of a boolean. (jason@php.net)
2001-02-20 05:36:40 +00:00
Andrei Zmievski
753e46657f Make php_array_merge() an API function. 2000-12-11 05:36:24 +00:00
Andrei Zmievski
a35bf41670 Added array_sum() function. 2000-10-25 17:40:11 +00:00
David Croft
83513d9580 Changed lots of PHP 3 licence headers to PHP 4, mainly in .h files.
Added a few RCS $Id$ tags.

# Note: I have avoided changing any .h files if the corresponding .c file
# had not already been changed as I am not sure if there are any legal
# issues here. So some extensions still have PHP 3 headers.
2000-07-24 01:40:02 +00:00
Andrei Zmievski
3ac0ae9dff @- Improved array_multisort() to be able to specify sort type as well sort
@  order. Incidentally, it can be used to sort multi-dimensional arrays
@  as well. (Andrei)
2000-07-11 16:48:03 +00:00
Sascha Schumann
16017f6d78 Change header protection macros to conform to standard.
Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment"

  All identifiers that begin with an underscore and either an uppercase
  letter or another underscore are always reserved for any use by the
  implementation.
2000-07-02 23:46:51 +00:00
Stig Venaas
f18b903d5f Changed array_subtract to array_diff 2000-06-10 19:09:56 +00:00
Stig Venaas
99f151f1bd Adding fuctions array_unique, array_intersect and array_subtract. 2000-06-10 18:58:45 +00:00
Andrei Zmievski
01a4220954 @- Added array_merge_recursive() that will recursively merge values
@  under the same keys. (Andrei)
2000-05-30 17:03:56 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Andrei Zmievski
a859e83392 Update for sort functions - user can now specify sort type. 2000-05-18 00:47:57 +00:00
Andrei Zmievski
fdbea075fa @- Added array_rand() function. (Andrei) 2000-05-09 19:27:00 +00:00
Andrei Zmievski
c7100c4a1a Added natural comparison/sorting routines using code from Martin Pool.
@- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(),
@  natsort(), and natcasesort(). These are useful for comparing and sorting
@  strings that contain numbers. Based on the code from Martin Pool
@  <mbp@humbug.org.au>. See http://www.linuxcare.com.au/projects/natsort/
@  for more info on natural sorting. (Andrei)
2000-04-12 19:39:02 +00:00
Stig Bakken
99e0b36321 @Cleaned up extension namespace (Stig)
Cleaned up extension namespace, and changed ext/standard into one single
extension.
2000-03-06 20:37:11 +00:00
Andrei Zmievski
457a13dac5 Finished array_multisort() function. Basically it sorts multiple arrays
similar to ORDER BY SQL clause.
@ Added array_multisort() function. (Andrei)
# Docs are coming soon
1999-12-13 19:42:26 +00:00
Andrei Zmievski
dbaf6c5c65 Added array globals in preparation for multisort() changes. 1999-12-11 22:42:01 +00:00
Stig Bakken
ae1b7bf4b8 @Fix warnings compiling in maintainer mode. (Stig)
Fix warnings compiling in maintainer mode.
Install DB/common.php and DB/mysql.php on "make install".
# We still have a warning from http_config.h:97.  Rasmus? :-)
1999-12-05 10:29:06 +00:00
Thies C. Arntzen
2451ff5368 @- Implemented array_flip() function. Returns input-array with key, value
@  flipped. (Thies)
(PHP array_flip) new function. no clash detection, only works for IS_STRING and IS_LONG datatypes in src-array.
1999-11-21 12:37:53 +00:00
Andrei Zmievski
438addf331 Split array functions into separate module. 1999-11-13 20:31:54 +00:00