PHP array_replace() functionThe array_replace() function is a built-in function in PHP. The PHP array_replace( ) function is used to replace the values of the first array with the values from following arrays. This function was introduced in PHP 5.3.0. SyntaxParameter
Return typeThe array_replace( ) function return the replaced array. It will return null if an error occurs. Example 1Output: Array ( [a] =>Pataliputra [b] =>chennai [0] => Noida ) Example 2Output: Array ( [a] =>javatpoint [0] => java [b] => PHP ) Example 3Output: Array ( [0] =>arjun [1] =>sehwag [2] =>kapil [3] =>rahul [4] =>klrahul ) Example 4Output: Array ( [j] =>javatpoint [p] =>php )
Next TopicPHP Array Functions
|