Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PHP retrieve information from array

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

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];
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading