Jump to content

Warning: array_merge() [function.array-merge]:


werushka

Recommended Posts

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... ???

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.