V
V
Valentine2018-01-31 01:40:04
PHP
Valentine, 2018-01-31 01:40:04

Is it possible to pass an array of options through a single input type text field?

Is it possible to pass an array of parameters through a single input type text field?
We need an implementation of a single-line command line so as not to enter requests through the address bar, and I would not like to parse one parameter into commands, as well as to make several input fields

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander, 2018-01-31
@valentinesowl

and I would not want to parse one parameter into commands, as well as make several input fields

One text field will pass one text parameter.
Here, however, you will have to parse this parameter either in a php script, or parse the text parameter in js and create fake text fields with the name "field_name[]".

S
Stalker_RED, 2018-01-31
@Stalker_RED

You can convert an array to a string.
php.net/manual/en/function.serialize.php

A
Ainur Valiev, 2018-01-31
@vaajnur

I understand you mean this

<input type="text" class="form-control" placeholder="Titel" name="levels[level][]">
 <input type="text" class="form-control" placeholder="Titel" name="levels[build_time][]">

respectively array access
$leveles['level'];
$leveles['build_time']

V
Valentine, 2018-02-05
@valentinesowl

Got it sorted, thanks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question