Will attempt to replace a specific value in a multidimensional array.
Parameters
$root
arrayrequired$keys
arrayrequired$value
mixedrequired- The value to update.
Source
* @param array $root
* @param array $keys
* @param mixed $value The value to update.
* @return mixed
*/
final protected function multidimensional_replace( $root, $keys, $value ) {
if ( ! isset( $value ) ) {
return $root;
} elseif ( empty( $keys ) ) { // If there are no keys, we're replacing the root.
return $value;
}
$result = $this->multidimensional( $root, $keys, true );
if ( isset( $result ) ) {
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.