PHP implode Invalid arguments passed

0 votes

I am using Codeigniter and its validation rules - a custom callback validation. I think this is not  CI-related. 

I've got this function to return a string :

function array_implode($a)
{
  return implode(',', $a);
}

But it always return a message, implode(): Invalid arguments passed

But var_dump() returns this:

array(2) {
  [0]=> string(10) "First item"
  [1]=> string(11) "Second item"
}

What am I doing wrong here? Can someone please help me with this?

Jun 13 in PHP by narikkadan
• 10,840 points
13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,720 points
1,487 views
0 votes
1 answer

How do you create optional arguments in php?

Hello @kartik, Use an equals (=) sign in ...READ MORE

answered Sep 17, 2020 in PHP by Niroj
• 82,720 points
296 views
0 votes
0 answers
0 votes
0 answers

PHP switch statement returns invalid output

The PHP switch statement returns invalid output : $cond ...READ MORE

Jun 9 in PHP by Kichu
• 19,040 points
9 views
0 votes
1 answer

What are the vulnerability related to PHP Form?

Hii, The $_SERVER["PHP_SELF"] variable can be used by ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
1,137 views
0 votes
1 answer

How can we avoid my php form from hacking?

Hii @kartik, If you want to know php ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,720 points
1,346 views
0 votes
1 answer

How to check if array is multidimensional or not?

Since the 'second dimension' could be just ...READ MORE

answered Nov 5, 2018 in Others by DataKing99
• 8,240 points
3,917 views
0 votes
1 answer

How to store input value into array then localstorage?

Hello @ abhittac, You have create the array everytime the ...READ MORE

answered Jul 24, 2020 in Java-Script by Niroj
• 82,720 points
4,508 views
0 votes
1 answer

Convert a PHP object to an associative array

Start with simply typecasting the line:- $array = ...READ MORE

answered Feb 23 in PHP by Aditya
• 7,280 points
108 views
0 votes
0 answers

php var_dump() vs print_r()

What is the difference between var_dump() and print_r() in terms of ...READ MORE

May 28 in PHP by Kichu
• 19,040 points
9 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP