Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get variable with same name in POST using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 764
    Comment on it

    Hello Reader's if have a html form with the variable of same name then you can get them indevisaly by POST

    Change the names of your inputs:

    <input name="name[]" value="Address" />
    <input name="name[]" value="Number"  />
    <input name="name[]" value="Age" />
    <input name="name[]" value="College" />
    

    Then you have to get these variable as below:-

    $_POST['name'][0] == 'Address'
    $_POST['name'][2] == 'Age'
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: