Re: [PHP] Array to String

2006-06-28 Thread Jochem Maas
Richard Lynch wrote: > On Mon, June 26, 2006 2:06 am, Jochem Maas wrote: >>> if (!get_magic_quotes_gpc()) { >>> if (isset($_POST)) { >>> foreach ($_POST as $key => $value) { >>> $_POST[$key] = trim(addslashes($value)); >>> } >>> } >>> >>> if (isset($_GET))

Re: [PHP] Array to String

2006-06-27 Thread Richard Lynch
On Mon, June 26, 2006 2:06 am, Jochem Maas wrote: >> if (!get_magic_quotes_gpc()) { >> if (isset($_POST)) { >> foreach ($_POST as $key => $value) { >> $_POST[$key] = trim(addslashes($value)); >> } >> } >> >> if (isset($_GET)) { >> foreach ($_GET as

Re: [PHP] Array to String

2006-06-26 Thread Jochem Maas
weetat wrote: > Hi all, > > I have the error below in my PHP version 4.3.2: > > PHP Notice: Array to string conversion in /data/html/library/config.php > on line 45 > > If i have turned "on" the magic_quotes in php.ini, it is ok . > Any ideas? > > It cause by the code below: > > if (!get_ma

Re: [PHP] Array to String

2006-06-25 Thread Chris
You are probably passing some variables into POST or GET using the array notation: /mypage.php?var[]=fred&var[]=wilma $_GET['var'] will be an array inside mypage.php, You should probably check to see if it's an array then, if it is, loop through each element of the var array Chris weetat w

RE: [PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
> $row is an entire array. you don't explode an entire array, you only > explode the contents of an element of an array. > > print_r($row) will give you some clues. > > you'll need to access a specific element within the array. like: > > $thearray = explode('__', $row[0][0]); That was it... Tha

RE: [PHP] Array to String conversion error

2004-03-16 Thread Chris W. Parker
Alex Hogan on Tuesday, March 16, 2004 9:48 AM said: > $row = mssql_fetch_array($result); > > $thearray = explode('__', $row); - This is line 40 $row is an entire array. you don't explode an entire array, you only explode the contents of an e

Re: [PHP] Array to string?

2003-10-14 Thread Douglas Douglas
I just found it: implode. Sorry to bother you. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array to string

2001-10-19 Thread R'twick Niceorgaw
try this $fupdatecontents=''; while ( list($key,$value) = each($fcontents) ) { $fupdatecontents .=$value; } $fcontents = $fupdatecontents; or just write $fupdatecontents into the file. You may need to add a \n after each line ( which I'm not sure);. If you need you can change the $fupdatecon

Re: [PHP] array to string

2001-10-19 Thread Steve Werby
"René Fournier" <[EMAIL PROTECTED]> wrote: > Just trying to convert an array to string before writing the whole thing > back out to a file. (Trying to do a simple database-less database, using > text files). > > $fcontents = file($name.".db"); // THE ENTIRE TABLE > $fcontents[$update] = $updated