I have a HTML form with multiple inputs.
I have the below php code to get them inputs and put them in an associated array.
However, when dumping the Associated array the value only shows the first letter...
<?php
$valueArray=array
(
"servername"=>'',
"serverlocation"=>'',
"servertype"=>'',
"serverdescription"=>''
);
foreach($valueArray as $key => $value)
{
if (isset($_POST[$key]))
{
$postValue = $_POST[$key];
$actualValue = $postValue;
$valueArray[$key][$value] = $actualValue;
}
}
var_dump($valueArray);
?>
This is what is dumped -
array(4) { ["servername"]=> string(1) "d" ["serverlocation"]=> string(1) "K" ["servertype"]=> string(1) "P" ["serverdescription"]=> string(1) "t" } post
How do i get it to store the whole string, and not just the first letter?