Reply to RE: [PHP] $_POST returns Array when getting data from multiple dropdown

Your name:

Reply:


Posted by "Albert" on 10/03/09 11:33

Erfan Shirazi wrote:
> I want to get all data passed on to a certain page, I use this to make
> it happen:
>
> foreach($_POST as $key => $tempvalue)
> {
> $cVariable .= $key."=".$tempvalue."&";
> }

Try:

<?
function getValues($arrayWithValues, $pre='') {
$tmpVal = '';

foreach($arrayWithValues as $key => $tempvalue) {
if (is_array($arrayWithValues[$key])) {
$tmpVal .= getValues($arrayWithValues[$key], $key);
} else {
$tmpVal .= $pre.$key."=".$tempvalue."&";
}
}

return $tmpVal;
}

$cVariable = getValues($_POST);

print $cVariable;
?>

Hope it helps

Albert

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 2005/11/30

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация