SlideShare a Scribd company logo
2
Most read
List of All PHP Array Functions


      Function                       Description                              Syntax

                                                                 array array_change_key_case ( array
array_change_key_case       Changes all keys in an array
                                                                 $input [, int $case = CASE_LOWER ] )

                                                                  array array_chunk ( array $input , int
     array_chunk              Split an array into chunks
                                                                 $size [, bool $preserve_keys = false ] )

                        Creates an array by using one array       array array_combine ( array $keys ,
    array_combine
                         for keys and another for its values                array $values )

                                                                    array array_count_values ( array
 array_count_values       Counts all the values of an array
                                                                                $input )
                         Computes the difference of arrays       array array_diff_assoc ( array $array1
   array_diff_assoc
                           with additional index check                , array $array2 [, array $... ] )

                         Computes the difference of arrays        array array_diff_key ( array $array1 ,
    array_diff_key
                           using keys for comparison                   array $array2 [, array $... ] )

                         Computes the difference of arrays
                                                                 array array_diff_uassoc ( array
                        with additional index check which is
  array_diff_uassoc                                            $array1 , array $array2 [, array $... ],
                            performed by a user supplied
                                                                  callback $key_compare_func )
                                  callback function
                         Computes the difference of arrays array array_diff_ukey ( array $array1 ,
   array_diff_ukey      using a callback function on the keys array $array2 [, array $ ... ], callback
                                   for comparison                      $key_compare_func )
                                                              array array_diff ( array $array1 , array
      array_diff         Computes the difference of arrays
                                                                       $array2 [, array $ ... ] )
                         Fill an array with values, specifying    array array_fill_keys ( array $keys ,
    array_fill_keys
                                          keys                              mixed $value )
                                                                  array array_fill ( int $start_index , int
       array_fill              Fill an array with values
                                                                         $num , mixed $value )

                         Filters elements of an array using a       array array_filter ( array $input [,
     array_filter
                                   callback function                      callback $callback ] )

                            Exchanges all keys with their
      array_flip                                                     array array_flip ( array $trans )
                            associated values in an array

                        Computes the intersection of arrays array array_intersect_assoc ( array
array_intersect_assoc
                           with additional index check      $array1 , array $array2 [, array $ ... ] )

                        Computes the intersection of arrays   array array_intersect_key ( array
 array_intersect_key
                           using keys for comparison        $array1 , array $array2 [, array $ ... ] )
Function                        Description                             Syntax


                          Computes the intersection of arrays
                                                                   array array_intersect_uassoc ( array
                             with additional index check,
array_intersect_uassoc                                             $array1 , array $array2 [, array $ ... ],
                           compares indexes by a callback
                                                                      callback $key_compare_func )
                                       function



                           Computes the intersection of arrays   array array_intersect_ukey ( array
 array_intersect_ukey     using a callback function on the keys $array1 , array $array2 [, array $... ],
                                     for comparison                callback $key_compare_func )
                                                                  array array_intersect ( array $array1 ,
    array_intersect       Computes the intersection of arrays
                                                                       array $array2 [, array $ ... ] )

                            Checks if the given key or index       bool array_key_exists ( mixed $key ,
   array_key_exists
                                  exists in the array                        array $search )

                                                                    array array_keys ( array $input [,
                          Return all the keys or a subset of the
      array_keys                                                 mixed $search_value [, bool $strict =
                                     keys of an array
                                                                                 false ]] )
                          Applies the callback to the elements array array_map ( callback $callback ,
      array_map
                                   of the given arrays                  array $arr1 [, array $... ] )
                                                                  array array_merge_recursive ( array
array_merge_recursive     Merge two or more arrays recursively
                                                                          $array1 [, array $... ] )
                                                                  array array_merge ( array $array1 [,
     array_merge               Merge one or more arrays
                                                                               array $... ] )
                                                                  bool array_multisort ( array &$arr [,
                           Sort multiple or multi-dimensional
    array_multisort                                              mixed $arg = SORT_ASC [, mixed $arg
                                          arrays
                                                                  = SORT_REGULAR [, mixed $... ]]] )
                          Pad array to the specified length with array array_pad ( array $input , int
      array_pad
                                          a value                    $pad_size , mixed $pad_value )
      array_pop           Pop the element off the end of array      mixed array_pop ( array &$array )
                          Calculate the product of values in an
    array_product                                                 number array_product ( array $array )
                                            array
                          Push one or more elements onto the      int array_push ( array &$array , mixed
      array_push
                                        end of array                        $var [, mixed $... ] )
                          Pick one or more random entries out      mixed array_rand ( array $input [, int
      array_rand
                                         of an array                          $num_req = 1 ] )
                             Iteratively reduce the array to a      mixed array_reduce ( array $input ,
     array_reduce              single value using a callback       callback $function [, mixed $initial =
                                          function                                NULL ] )
                                                                   array array_replace_recursive ( array
                            Replaces elements from passed
array_replace_recursive                                           &$array , array &$array1 [, array &$... ]
                          arrays into the first array recursively
                                                                                      )
Function                     Description                            Syntax


                      Replaces elements from passed         array array_replace ( array &$array ,
  array_replace
                         arrays into the first array           array &$array1 [, array &$... ] )



                      Return an array with elements in       array array_reverse ( array $array [,
 array_reverse
                               reverse order                   bool $preserve_keys = false ] )


                    Searches the array for a given value mixed array_search ( mixed $needle ,
  array_search      and returns the corresponding key if array $haystack [, bool $strict = false ]
                                 successful                                 )



                    Shift an element off the beginning of
   array_shift                                               mixed array_shift ( array &$array )
                                   array


                                                             array array_slice ( array $array , int
   array_slice           Extract a slice of the array            $offset [, int $length [, bool
                                                                 $preserve_keys = false ]] )


                                                            array array_splice ( array &$input , int
                     Remove a portion of the array and
  array_splice                                                 $offset [, int $length = 0 [, mixed
                       replace it with something else
                                                                       $replacement ]] )


                      Calculate the sum of values in an
   array_sum                                                 number array_sum ( array $array )
                                    array




                     Computes the difference of arrays     array array_udiff_assoc ( array
array_udiff_assoc      with additional index check,      $array1 , array $array2 [, array $ ... ],
                    compares data by a callback function   callback $data_compare_func )
Function                        Description                            Syntax




                           Computes the difference of arrays        array array_udiff_uassoc ( array
                              with additional index check,        $array1 , array $array2 [, array $ ... ],
  array_udiff_uassoc
                            compares data and indexes by a          callback $data_compare_func ,
                                   callback function                 callback $key_compare_func )




                          Computes the difference of arrays by  array array_udiff ( array $array1 ,
      array_udiff          using a callback function for data  array $array2 [, array $ ... ], callback
                                      comparison                      $data_compare_func )




                           Computes the intersection of arrays array array_uintersect_assoc ( array
array_uintersect_assoc        with additional index check,     $array1 , array $array2 [, array $ ... ],
                          compares data by a callback function    callback $data_compare_func )




                          Computes the intersection of arrays array array_uintersect_uassoc ( array
                             with additional index check,      $array1 , array $array2 [, array $ ... ],
array_uintersect_uassoc
                           compares data and indexes by a        callback $data_compare_func ,
                                  callback functions              callback $key_compare_func )
Function                       Description                           Syntax



                                                            array array_uintersect ( array $array1 ,
                       Computes the intersection of arrays,
  array_uintersect                                           array $array2 [, array $ ... ], callback
                       compares data by a callback function
                                                                    $data_compare_func )




                        Removes duplicate values from an array array_unique ( array $array [, int
   array_unique
                                     array                  $sort_flags = SORT_STRING ] )




                       Prepend one or more elements to the      int array_unshift ( array &$array ,
   array_unshift
                              beginning of an array                 mixed $var [, mixed $... ] )



   array_values          Return all the values of an array      array array_values ( array $input )




                                                              bool array_walk_recursive ( array
                       Apply a user function recursively to
array_walk_recursive                                        &$input , callback $funcname [, mixed
                           every member of an array
                                                                          $userdata ] )




                                                                bool array_walk ( array &$array ,
                          Apply a user function to every
    array_walk                                                    callback $funcname [, mixed
                               member of an array
                                                                          $userdata ] )




       array                      Create an array                   array array ([ mixed $... ] )



                        Sort an array in reverse order and       bool arsort ( array &$array [, int
       arsort
                           maintain index association           $sort_flags = SORT_REGULAR ] )
Function                Description                             Syntax


             Sort an array and maintain index          bool asort ( array &$array [, int
 asort
                        association                   $sort_flags = SORT_REGULAR ] )




           Create array containing variables and      array compact ( mixed $varname [,
compact
                        their values                            mixed $... ] )




             Count all elements in an array, or      int count ( mixed $var [, int $mode =
 count
                 properties in an object                     COUNT_NORMAL ] )




             Return the current element in an
current                                                 mixed current ( array &$array )
                          array




           Return the current key and value pair
 each      from an array and advance the array            array each ( array &$array )
                          cursor




           Set the internal pointer of an array to
  end                                                     mixed end ( array &$array )
                       its last element




                                                      int extract ( array &$var_array [, int
             Import variables into the current
extract                                              $extract_type = EXTR_OVERWRITE [,
               symbol table from an array
                                                                string $prefix ]] )
Function                 Description                            Syntax




                                                      bool in_array ( mixed $needle , array
 in_array     Checks if a value exists in an array
                                                      $haystack [, bool $strict = FALSE ] )




   key             Fetch a key from an array              mixed key ( array &$array )



                                                        bool krsort ( array &$array [, int
  krsort      Sort an array by key in reverse order
                                                       $sort_flags = SORT_REGULAR ] )




                                                        bool ksort ( array &$array [, int
   ksort              Sort an array by key
                                                       $sort_flags = SORT_REGULAR ] )




              Assign variables as if they were an     array list ( mixed $varname [, mixed
    list
                            array                                      $... ] )




                   Sort an array using a case
natcasesort                                            bool natcasesort ( array &$array )
              insensitive "natural order" algorithm




              Sort an array using a "natural order"
  natsort                                                bool natsort ( array &$array )
                            algorithm




              Advance the internal array pointer of
   next                                                   mixed next ( array &$array )
                           an array
Function                Description                           Syntax

  pos                Alias of current()


  prev       Rewind the internal array pointer         mixed prev ( array &$array )



           Create an array containing a range of     array range ( mixed $start , mixed
 range
                         elements                       $limit [, number $step = 1 ] )


           Set the internal pointer of an array to
 reset                                                 mixed reset ( array &$array )
                      its first element
                                                      bool rsort ( array &$array [, int
 rsort        Sort an array in reverse order
                                                     $sort_flags = SORT_REGULAR ] )
shuffle               Shuffle an array                 bool shuffle ( array &$array )
 sizeof               Alias of count()
                                                       bool sort ( array &$array [, int
  sort                 Sort an array
                                                     $sort_flags = SORT_REGULAR ] )
             Sort an array with a user-defined
                                                 bool uasort ( array &$array , callback
 uasort     comparison function and maintain
                                                           $cmp_function )
                     index association
            Sort an array by keys using a user- bool uksort ( array &$array , callback
 uksort
               defined comparison function                 $cmp_function )
           Sort an array by values using a user- bool usort ( array &$array , callback
 usort
               defined comparison function                 $cmp_function )

More Related Content

What's hot (20)

PPT
Control Structures In Php 2
Digital Insights - Digital Marketing Agency
 
PPTX
Object Oriented Programming In JavaScript
Forziatech
 
PPTX
Php with mysql ppt
Rajamanickam Gomathijayam
 
PPTX
Html5 and-css3-overview
Jacob Nelson
 
DOCX
Sql
navsissuk
 
PDF
Html tags or elements
Webtech Learning
 
PPTX
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Deepak Upadhyay
 
PPTX
Css box-model
Webtech Learning
 
PDF
Flexbox and Grid Layout
Rachel Andrew
 
PPT
Learning HTML
Md. Sirajus Salayhin
 
PPT
Css Specificity
manugoel2003
 
PPTX
Css position
Webtech Learning
 
PPTX
Angular 2.0 forms
Eyal Vardi
 
PPTX
Links in Html
sadeenedian08
 
PPTX
CSS Flexbox (flexible box layout)
Woodridge Software
 
PPTX
PHP FUNCTIONS
Zeeshan Ahmed
 
PPTX
CSS tutorial chapter 1
jeweltutin
 
PPTX
Regular expressions and php
David Stockton
 
PDF
Java script aula 07 - j-query
Cristiano Pires Martins
 
Control Structures In Php 2
Digital Insights - Digital Marketing Agency
 
Object Oriented Programming In JavaScript
Forziatech
 
Php with mysql ppt
Rajamanickam Gomathijayam
 
Html5 and-css3-overview
Jacob Nelson
 
Html tags or elements
Webtech Learning
 
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Deepak Upadhyay
 
Css box-model
Webtech Learning
 
Flexbox and Grid Layout
Rachel Andrew
 
Learning HTML
Md. Sirajus Salayhin
 
Css Specificity
manugoel2003
 
Css position
Webtech Learning
 
Angular 2.0 forms
Eyal Vardi
 
Links in Html
sadeenedian08
 
CSS Flexbox (flexible box layout)
Woodridge Software
 
PHP FUNCTIONS
Zeeshan Ahmed
 
CSS tutorial chapter 1
jeweltutin
 
Regular expressions and php
David Stockton
 
Java script aula 07 - j-query
Cristiano Pires Martins
 

Similar to List of all php array functions (20)

PPTX
Array functions for all languages prog.pptx
Asmi309059
 
PPTX
Array functions using php programming language.pptx
NikhilVij6
 
PPTX
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
PPT
Php Chapter 2 3 Training
Chris Chubb
 
PDF
Ms Ajax Array Extensions
jason hu 金良胡
 
PPTX
Chapter 2 wbp.pptx
40NehaPagariya
 
PPTX
Chap 3php array part 3
monikadeshmane
 
DOC
9
satishbb
 
PPTX
Marcs (bio)perl course
BITS
 
PDF
Underscore.js
timourian
 
PDF
Php array
Nikul Shah
 
PPTX
Chap 3php array part4
monikadeshmane
 
PPTX
Unit 2-Arrays.pptx
mythili213835
 
PPTX
PHP Array Functions.pptx
KirenKinu
 
PPTX
Programming Basics - array, loops, funcitons
Trivuz ত্রিভুজ
 
PDF
Array String - Web Programming
Amirul Azhar
 
PPT
arrays.ppt
SchoolEducationDepar
 
PPT
arrays.ppt
SchoolEducationDepar
 
PPT
Class 4 - PHP Arrays
Ahmed Swilam
 
Array functions for all languages prog.pptx
Asmi309059
 
Array functions using php programming language.pptx
NikhilVij6
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
Php Chapter 2 3 Training
Chris Chubb
 
Ms Ajax Array Extensions
jason hu 金良胡
 
Chapter 2 wbp.pptx
40NehaPagariya
 
Chap 3php array part 3
monikadeshmane
 
Marcs (bio)perl course
BITS
 
Underscore.js
timourian
 
Php array
Nikul Shah
 
Chap 3php array part4
monikadeshmane
 
Unit 2-Arrays.pptx
mythili213835
 
PHP Array Functions.pptx
KirenKinu
 
Programming Basics - array, loops, funcitons
Trivuz ত্রিভুজ
 
Array String - Web Programming
Amirul Azhar
 
Class 4 - PHP Arrays
Ahmed Swilam
 
Ad

Recently uploaded (20)

DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Ad

List of all php array functions

  • 1. List of All PHP Array Functions Function Description Syntax array array_change_key_case ( array array_change_key_case Changes all keys in an array $input [, int $case = CASE_LOWER ] ) array array_chunk ( array $input , int array_chunk Split an array into chunks $size [, bool $preserve_keys = false ] ) Creates an array by using one array array array_combine ( array $keys , array_combine for keys and another for its values array $values ) array array_count_values ( array array_count_values Counts all the values of an array $input ) Computes the difference of arrays array array_diff_assoc ( array $array1 array_diff_assoc with additional index check , array $array2 [, array $... ] ) Computes the difference of arrays array array_diff_key ( array $array1 , array_diff_key using keys for comparison array $array2 [, array $... ] ) Computes the difference of arrays array array_diff_uassoc ( array with additional index check which is array_diff_uassoc $array1 , array $array2 [, array $... ], performed by a user supplied callback $key_compare_func ) callback function Computes the difference of arrays array array_diff_ukey ( array $array1 , array_diff_ukey using a callback function on the keys array $array2 [, array $ ... ], callback for comparison $key_compare_func ) array array_diff ( array $array1 , array array_diff Computes the difference of arrays $array2 [, array $ ... ] ) Fill an array with values, specifying array array_fill_keys ( array $keys , array_fill_keys keys mixed $value ) array array_fill ( int $start_index , int array_fill Fill an array with values $num , mixed $value ) Filters elements of an array using a array array_filter ( array $input [, array_filter callback function callback $callback ] ) Exchanges all keys with their array_flip array array_flip ( array $trans ) associated values in an array Computes the intersection of arrays array array_intersect_assoc ( array array_intersect_assoc with additional index check $array1 , array $array2 [, array $ ... ] ) Computes the intersection of arrays array array_intersect_key ( array array_intersect_key using keys for comparison $array1 , array $array2 [, array $ ... ] )
  • 2. Function Description Syntax Computes the intersection of arrays array array_intersect_uassoc ( array with additional index check, array_intersect_uassoc $array1 , array $array2 [, array $ ... ], compares indexes by a callback callback $key_compare_func ) function Computes the intersection of arrays array array_intersect_ukey ( array array_intersect_ukey using a callback function on the keys $array1 , array $array2 [, array $... ], for comparison callback $key_compare_func ) array array_intersect ( array $array1 , array_intersect Computes the intersection of arrays array $array2 [, array $ ... ] ) Checks if the given key or index bool array_key_exists ( mixed $key , array_key_exists exists in the array array $search ) array array_keys ( array $input [, Return all the keys or a subset of the array_keys mixed $search_value [, bool $strict = keys of an array false ]] ) Applies the callback to the elements array array_map ( callback $callback , array_map of the given arrays array $arr1 [, array $... ] ) array array_merge_recursive ( array array_merge_recursive Merge two or more arrays recursively $array1 [, array $... ] ) array array_merge ( array $array1 [, array_merge Merge one or more arrays array $... ] ) bool array_multisort ( array &$arr [, Sort multiple or multi-dimensional array_multisort mixed $arg = SORT_ASC [, mixed $arg arrays = SORT_REGULAR [, mixed $... ]]] ) Pad array to the specified length with array array_pad ( array $input , int array_pad a value $pad_size , mixed $pad_value ) array_pop Pop the element off the end of array mixed array_pop ( array &$array ) Calculate the product of values in an array_product number array_product ( array $array ) array Push one or more elements onto the int array_push ( array &$array , mixed array_push end of array $var [, mixed $... ] ) Pick one or more random entries out mixed array_rand ( array $input [, int array_rand of an array $num_req = 1 ] ) Iteratively reduce the array to a mixed array_reduce ( array $input , array_reduce single value using a callback callback $function [, mixed $initial = function NULL ] ) array array_replace_recursive ( array Replaces elements from passed array_replace_recursive &$array , array &$array1 [, array &$... ] arrays into the first array recursively )
  • 3. Function Description Syntax Replaces elements from passed array array_replace ( array &$array , array_replace arrays into the first array array &$array1 [, array &$... ] ) Return an array with elements in array array_reverse ( array $array [, array_reverse reverse order bool $preserve_keys = false ] ) Searches the array for a given value mixed array_search ( mixed $needle , array_search and returns the corresponding key if array $haystack [, bool $strict = false ] successful ) Shift an element off the beginning of array_shift mixed array_shift ( array &$array ) array array array_slice ( array $array , int array_slice Extract a slice of the array $offset [, int $length [, bool $preserve_keys = false ]] ) array array_splice ( array &$input , int Remove a portion of the array and array_splice $offset [, int $length = 0 [, mixed replace it with something else $replacement ]] ) Calculate the sum of values in an array_sum number array_sum ( array $array ) array Computes the difference of arrays array array_udiff_assoc ( array array_udiff_assoc with additional index check, $array1 , array $array2 [, array $ ... ], compares data by a callback function callback $data_compare_func )
  • 4. Function Description Syntax Computes the difference of arrays array array_udiff_uassoc ( array with additional index check, $array1 , array $array2 [, array $ ... ], array_udiff_uassoc compares data and indexes by a callback $data_compare_func , callback function callback $key_compare_func ) Computes the difference of arrays by array array_udiff ( array $array1 , array_udiff using a callback function for data array $array2 [, array $ ... ], callback comparison $data_compare_func ) Computes the intersection of arrays array array_uintersect_assoc ( array array_uintersect_assoc with additional index check, $array1 , array $array2 [, array $ ... ], compares data by a callback function callback $data_compare_func ) Computes the intersection of arrays array array_uintersect_uassoc ( array with additional index check, $array1 , array $array2 [, array $ ... ], array_uintersect_uassoc compares data and indexes by a callback $data_compare_func , callback functions callback $key_compare_func )
  • 5. Function Description Syntax array array_uintersect ( array $array1 , Computes the intersection of arrays, array_uintersect array $array2 [, array $ ... ], callback compares data by a callback function $data_compare_func ) Removes duplicate values from an array array_unique ( array $array [, int array_unique array $sort_flags = SORT_STRING ] ) Prepend one or more elements to the int array_unshift ( array &$array , array_unshift beginning of an array mixed $var [, mixed $... ] ) array_values Return all the values of an array array array_values ( array $input ) bool array_walk_recursive ( array Apply a user function recursively to array_walk_recursive &$input , callback $funcname [, mixed every member of an array $userdata ] ) bool array_walk ( array &$array , Apply a user function to every array_walk callback $funcname [, mixed member of an array $userdata ] ) array Create an array array array ([ mixed $... ] ) Sort an array in reverse order and bool arsort ( array &$array [, int arsort maintain index association $sort_flags = SORT_REGULAR ] )
  • 6. Function Description Syntax Sort an array and maintain index bool asort ( array &$array [, int asort association $sort_flags = SORT_REGULAR ] ) Create array containing variables and array compact ( mixed $varname [, compact their values mixed $... ] ) Count all elements in an array, or int count ( mixed $var [, int $mode = count properties in an object COUNT_NORMAL ] ) Return the current element in an current mixed current ( array &$array ) array Return the current key and value pair each from an array and advance the array array each ( array &$array ) cursor Set the internal pointer of an array to end mixed end ( array &$array ) its last element int extract ( array &$var_array [, int Import variables into the current extract $extract_type = EXTR_OVERWRITE [, symbol table from an array string $prefix ]] )
  • 7. Function Description Syntax bool in_array ( mixed $needle , array in_array Checks if a value exists in an array $haystack [, bool $strict = FALSE ] ) key Fetch a key from an array mixed key ( array &$array ) bool krsort ( array &$array [, int krsort Sort an array by key in reverse order $sort_flags = SORT_REGULAR ] ) bool ksort ( array &$array [, int ksort Sort an array by key $sort_flags = SORT_REGULAR ] ) Assign variables as if they were an array list ( mixed $varname [, mixed list array $... ] ) Sort an array using a case natcasesort bool natcasesort ( array &$array ) insensitive "natural order" algorithm Sort an array using a "natural order" natsort bool natsort ( array &$array ) algorithm Advance the internal array pointer of next mixed next ( array &$array ) an array
  • 8. Function Description Syntax pos Alias of current() prev Rewind the internal array pointer mixed prev ( array &$array ) Create an array containing a range of array range ( mixed $start , mixed range elements $limit [, number $step = 1 ] ) Set the internal pointer of an array to reset mixed reset ( array &$array ) its first element bool rsort ( array &$array [, int rsort Sort an array in reverse order $sort_flags = SORT_REGULAR ] ) shuffle Shuffle an array bool shuffle ( array &$array ) sizeof Alias of count() bool sort ( array &$array [, int sort Sort an array $sort_flags = SORT_REGULAR ] ) Sort an array with a user-defined bool uasort ( array &$array , callback uasort comparison function and maintain $cmp_function ) index association Sort an array by keys using a user- bool uksort ( array &$array , callback uksort defined comparison function $cmp_function ) Sort an array by values using a user- bool usort ( array &$array , callback usort defined comparison function $cmp_function )