werushka Posted December 31, 2007 Share Posted December 31, 2007 Hi guys my server is in PHP 5 so that is why i am getting these problems but there are fixes that I know can be done to correct these problems. If i can get the logic of it if it happens in the future I can fix it but for now I don't know how to solve problems like this because I am noob in PHP coding. the warning messages are as follows. Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/vhosts/duyurdum.com/httpdocs/administrator/components/com_ja_submit/admin.ja_submit.php on line 166 the code in line 166 is $usertypes=array_merge($usertypes1,$usertypes2); Warning: Invalid argument supplied for foreach() in /var/www/vhosts/duyurdum.com/httpdocs/administrator/components/com_ja_submit/admin.ja_submit.php on line 178 the code in line 178 is oreach ($usertypes AS $usertype){ Warning: current() [function.current]: Passed variable is not an array or object in /var/www/vhosts/duyurdum.com/httpdocs/libraries/joomla/html/html/select.php on line 68 the code in line 68 is while(current($arr) !== FALSE) I really really appreciate any help... ??? Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/ Share on other sites More sharing options...
p2grace Posted December 31, 2007 Share Posted December 31, 2007 Question 1: Are you sure $usertypes1 and $usertypes2 are both arrays? Question2: Try foreach($usertypes as $usertype){ echo $usertype; // To see what it prints } If that doesn't work then I'd check and make sure $usertypes is an array. Be sure to change your "AS" to "as" (lowercase). Question 3: What exactly are you trying to accomplish with your code? If you just want to know if it is false you can do it with "!=" as long as you don't care about the data type. Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/#findComment-426733 Share on other sites More sharing options...
werushka Posted December 31, 2007 Author Share Posted December 31, 2007 Thanks for your fast reply, the code is from a joomla componenet. I have instelled it and when usign it it shows these errors. I have searched internet about these king of errors and I have come accross that the problem is php5 related, this forum is php lrelated that is why i posted here. Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/#findComment-426741 Share on other sites More sharing options...
p2grace Posted December 31, 2007 Share Posted December 31, 2007 All of the functions you asked about are supported in php 5. Does the code still work even when errors are being generated? Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/#findComment-426746 Share on other sites More sharing options...
werushka Posted December 31, 2007 Author Share Posted December 31, 2007 Nope Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/#findComment-426763 Share on other sites More sharing options...
p2grace Posted December 31, 2007 Share Posted December 31, 2007 Then I'd have to stick with what I said earlier. Does Joomla have any updates out where you could update to a newer version? Otherwise you'll have to be willing to search through their code and make sure the arrays exist. Quote Link to comment https://forums.phpfreaks.com/topic/83849-warning-array_merge-functionarray-merge/#findComment-426765 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.