implode errors

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Paul Oertel
Forum Newbie
Posts: 18
Joined: Fri May 31, 2002 3:44 am
Location: Japan

implode errors

Post by Paul Oertel »

I am having trouble with the implode function. I provides the right result but it is also spitting out an error.

I read a line from a file into $str using fgetcsv. I do some checks on the value of some of the elements of the $str array and then I put it back into a regular string.

This is the code I am using.

Code: Select all

$str = fgetcsv ($fp, 1000, ",");
			
$whole_string = implode(",", $str);
When I echo $whole_string it returns the proper value but I am also getting the following error each time.

Code: Select all

<b>Warning</b>:  implode() &#1111;<a href='http://www.php.net/function.implode'>function.implode</a>]: Bad
 arguments. in <b>C:\mimi\alerter.php</b> on line <b>83</b><br />
I would appreciate any help that I can get on this.

Paul
User avatar
mesz
Forum Contributor
Posts: 216
Joined: Fri May 23, 2003 8:11 am
Location: M/cr

Re: implode errors

Post by mesz »

[quote="Paul Oertel"]

Code: Select all

$str = fgetcsv ($fp, 1000, ",");
			
$whole_string = implode(",", $str);
Try

Code: Select all

$whole_string = implode(",". $str);
Post Reply