note 73870 deleted from ref.array by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: piotr dot galas+phpnet at gmail dot com 

----

Function which converts array to string but not serialize it.

function arraytostring($array)
{
	$text.="array(";
	$count=count($array);

	foreach ($array as $key=>$value)
	{
		$x++;

		if (is_array($value))
		{
			if(substr($text,-1,1)==')')	$text .= ',';
			$text.='"'.$key.'"'."=>".arraytostring($value);
			continue;
		}

		$text.="\"$key\"=>\"$value\"";

		if ($count!=$x) $text.=",";
	}

	$text.=")";

	if(substr($text, -4, 4)=='),),')$text.='))';

	return $text;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.