Fatal Error Call To Undefined Function Array_replace_recursive
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
Array Replace Recursive Php
Overflow the company Business Learn more about hiring developers or posting ads with us array_merge_recursive Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php: array_replace_recursive alternative up vote 5 down vote favorite 1 I need a solution for array_replace_recursive, because my php-version isn't high enough. I want to use this code: $_GET = array_replace_recursive($_GET, array("__amp__"=>"&")); easy, isn't it? php arrays share|improve this question edited May 20 '10 at 13:21 SilentGhost 126k33220236 asked May 20 '10 at 13:18 Glubber 2612 add a comment| 2 Answers 2 active oldest votes up vote 5 down vote On the PHP docs page for array_replace_recursive, someone posted the following source code to use in place of it: $value) { // create new key in $array, if it is empty or not an array if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) { $array[$key] = array(); } // overwrite the value in the base array if (is_array($value)) { $value = recurse($array[$key], $value); } $array[$key] = $value; } return $array; } // handle the arguments, merge one by one $args = func_get_args(); $array = $args[0]; if (!is_array($array)) { return $array; } for ($i = 1; $i < count($args); $i++) { if (is_array($args[$i])) { $array = recurse($array, $args[$i]); } } return $array; } } ?> share|improve this answer answered May 20 '10 at 13:20 Justin Ethier 76.4k37177240 1 When using the function more than once, I get: Fatal error: Cannot redeclare recurse() –mikewasmike Mar 12 '15 at 8:36 add a comment| up vote 1 down vote The code above by @Justin is ok, save for 2 things: Function is not readily available at start of php execution be cause it is wrapped in if(). PHP docu says When a function is defined in a conditional manner such as the two examples shown. Its definition must be processed prior to being
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes Community AccountingIssues array_replace_recursive only available php > 5.3 Closed (fixed)Project:Community AccountingVersion:7.x-3.x-devComponent:TransactionsPriority:MajorCategory:Bug reportAssigned:UnassignedReporter:bruitismCreated:April 21, 2012 - 09:05Updated:May 2, 2012 - 07:03 Log in or register http://stackoverflow.com/questions/2874035/php-array-replace-recursive-alternative to update this issue array_replace_recursive is only available for php >= 5.3 and thus does throw error on older servers. Since 5.2 is the minimu requirement for drupal I would suggest replacing this with something else. Fatal error: Call https://www.drupal.org/node/1541594 to undefined function array_replace_recursive() in mutual_credit/forms/mcapi_forms.inc on line 120 Comments Comment #1 bruitism CreditAttribution: bruitism commented May 2, 2012 at 7:03am Status: Active » Closed (fixed) fixed in latest dev Log in or register to post comments Add child issue, clone issue News itemsDrupal news Planet Drupal Association news Social media directory Security announcements Jobs Our communityCommunity Getting involved Services, Training & Hosting Groups & Meetups DrupalCon Code of conduct DocumentationDocumentation Drupal 8 docs Drupal 7 docs Developer docs api.drupal.org Drupal code baseDownload & Extend Drupal core Modules Themes Distributions Governance of communityAbout Web accessibility The Drupal Association About Drupal.org Terms of service Privacy policy Drupal is a registered trademark of Dries Buytaert.
Sign in Pricing Blog Support Search GitHub This repository Watch 23 Star 126 Fork 49 bainternet/Admin-Page-Class Code Issues 6 Pull requests 1 Projects 0 Pulse Graphs New issue Don't work with fatal error php 5.2 :-( #58 Open absoluteweb opened this Issue Oct 12, 2014 · 0 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 1 participant absoluteweb fatal error call commented Oct 12, 2014 Hi, Fatal error: Call to undefined function array_replace_recursive() array_replace_recursive (PHP 5 >= 5.3.0) array_replace_recursive — Replaces elements from passed arrays into the first array recursively Nicolas. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.