note 87384 added to ref.array
| From: | cristiano at galvao dot pro dot br | Date: | Tue, 02 Dec 2008 23:22:29 +0000 |
| Subject: | note 87384 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147570@lists.php.net to get a copy of this message | ||
I made this 'Array to String' function:
//<--- ARRAY TO STRING:
function array_to_string( $array, $separator ) {
if( is_array( $array ) ) {
foreach( $array as $element ) {
$string .= $element . $separator;
}
$string = substr( $string, 0, - strlen( $separator ) );
}
return $string;
}
Note that to transform back into array, we just need to use standard PHP split function.
Cristiano Galvão
http://www.galvao.pro.br
----
Server IP: 69.147.83.197
Probable Submitter: 201.8.45.97
----
Manual Page -- http://www.php.net/manual/en/ref.array.php
Edit -- https://master.php.net/note/edit/87384
Del: integrated -- https://master.php.net/note/delete/87384/integrated
Del: useless -- https://master.php.net/note/delete/87384/useless
Del: bad code -- https://master.php.net/note/delete/87384/bad+code
Del: spam -- https://master.php.net/note/delete/87384/spam
Del: non-english -- https://master.php.net/note/delete/87384/non-english
Del: in docs -- https://master.php.net/note/delete/87384/in+docs
Del: other reasons-- https://master.php.net/note/delete/87384
Reject -- https://master.php.net/note/reject/87384
Search -- https://master.php.net/manage/user-notes.php