5

When I submit the form by post method i am getting the value like this for an array.

 array
 'custom_profile_type' => 
    array
       0 => string '39242' (length=5)
    'satori_programme' => string '0' (length=1)

I want the value 39242 from above array. How to get that? Any idea guys ?

3 Answers 3

5

Access it like..

echo $yourarray['custom_profile_type'][0];
Sign up to request clarification or add additional context in comments.

Comments

4
 echo  $array['custom_profile_type'][0];

1 Comment

@ShankarDamodaran,Ya,misterManSam updated.Thanks,sory for my mistake
3

Access Using The Below Code | You can add loop to get all values like below

Static Code

  echo  $array['custom_profile_type'][6]
  echo  $array['custom_profile_type'][0]

Dynamic Code

<?php
$array = $_POST['custom_profile_type'];

foreach($array as $key => $value) {
    echo $key . " => " . $value;
}
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.