Form with multiple input with same name


Is it possible to use the following structure and store input of same name into an array where input name is in the form of name=“data[]”?

    <form id="my-form" class="list form-store-data">
         <input type="text" name="data[]">Data 1</input>
         <input type="text" name="data[]">Data 2</input>

Output: data[“Data 1”, “Data 2”]
At the moment, I have to write a separate javascript to manually create a name called data_manual_id for each input field which isn’t very efficient.

Any advice?