ARTICLES POSTED IN THE " PHP Array" CATEGORY

  • PHP Array Functions

    PHP Array Functions

    PHP array functions allow you to access and manipulate arrays. Lot of array functions are available in php and i added most of the array functions in this article


  • array_change_key_case

    array_change_key_case

    Syntax:array array_change_key_case ( array $input [, int $case = CASE_LOWER ] ) Description: Changes all keys in an array <?php $input_array = array("FirSt" => 1, "SecOnd" => 'Hai'); print_r( array_change_key_case ( $input_array, CASE_UPPER ) […]


  • array_chunk

    array_chunk

    Syntax:array array_chunk ( array $input , int $size [, bool $preserve_keys = false ] ) Description:Split an array into chunks <?php $input_array = array('a', 'b', 'c'); print_r( array_chunk ( $input_array, 2) ); print_r( array_chunk […]


  • array_combine

    array_combine

    Syntax:array array_combine ( array $keys , array $values ) Description:Creates an array by using one array for keys and another for its values <?php $a = array('green', 'red', 'yellow'); $b = array('avocado', 'apple', 'banana'); […]


  • array_count_values

    array_count_values

    Syntax:array array_count_values ( array $input ) Description:Counts all the values of an array <?php $array = array(1, "hello", 1, "world", "hello"); print_r(array_count_values($array)); ?> OUTPUT <?php Array ( [1] => 2 [hello] => 2 [world] […]


  • array_diff

    array_diff

    Syntax:array array_diff_assoc ( array $array1 , array $array2 [, array $… ] ) Description:Computes the difference of arrays with additional index check <?php $array1 = array("a" => "green", "b" => "brown", "c" => "blue", […]


  • array_diff_key

    array_diff_key

    Syntax:array array_diff_key ( array $array1 , array $array2 [, array $… ] ) Description:Computes the difference of arrays using keys for comparison <?php $array1 = array('blue' => 1, 'red' => 2, 'green' => 3, […]


  • array_diff_assoc

    array_diff_assoc

    b>Syntax:array array_diff_assoc ( array $array1 , array $array2 [, array $… ] ) Description:Computes the difference of arrays with additional index check <?php $array1 = array("a" => "green", "b" => "brown", "c" => "blue", […]


  • array_diff_uassoc

    array_diff_uassoc

    Syntax:array array_diff_uassoc ( array $array1 , array $array2 [, array $… ], callable $key_compare_func ) Description:Computes the difference of arrays with additional index check which is performed by a user supplied callback function <?php […]


  • array_diff_ukey

    array_diff_ukey

    Syntax:array array_diff_ukey ( array $array1 , array $array2 [, array $ … ], callable $key_compare_func ) Description:Computes the difference of arrays using a callback function on the keys for comparison <?php function key_compare_func($key1, $key2) […]