PHP array_replace_recursive( ) functionThe array_replace_recursive() function is an inbuilt function of PHP. The array_replace_recursive( ) function is used to replace the values from passed arrays into the first array recursively. This function was introduced in PHP 5.3.0. SyntaxParameter
Return typeThe array_replace_recursive( ) function returns the replaced array. It will return null if an error occurs. Example 1Output: Array ( [a] => Array ( [0] => all ) [b] => Array ( [0] => black ) ) Example 2Output: Array ( [a] => Array ( [0] => saffron ) [b] => Array ( [0] => pink [1] => red ) ) Example 3Output: Array ( [a] => Array ( [0] => yuvraj ) [b] => Array ( [0] => ishant [1] => sehwag ) ) Example 4Output: Array ( [a] => Array ( [0] => Perl ) [b] => Array ( [0] => HTML [1] => PHP ) )
Next TopicPHP Array Functions
|