I need pick up values from array.
My code:
$tags = $array['bePVM'][''];
echo ('<form action="" method="POST">');
for($o = 0; $o<$i; $o ){
echo "<br>Užsakymo: <b> ",$data2DArray[$o][0], "</b> Price witout VAT: ",'<input type="text" name="bePVM[]" value="">'," VAT: ",'<input type="text" name="PVM[]" value="">'," Price with VAT: ",'<input type="text" name="suPVM[]" value="">',"<br>";
}
echo ('<input type="submit" value="">');
echo ('</form>');
print_r($_POST);
echo $tags[1];
And i have this output:
Warning: Trying to access array offset on value of type null
Array ( [bePVM] => Array ( [0] => 100
[1] => 200 )
[PVM] => Array ( [0] => 21
[1] => 42 )
[suPVM] => Array ( [0] => 121
[1] => 242 )
)
How can i echo [bePVM][1] where is 200?
thanks
CodePudding user response:
How can i echo [bePVM][1] where is 200?
If he output is from print_r($_POST);
then this should write 200
to the output:
echo $_POST['bePVM'][1];