Hello everyone!
Interested in this solution puzzles. There is such a HTML code
<input type="text" name="comp" placeholder="Comp" /><br> <input type="text" name="name[]" placeholder="name1" /><br> <input type="text" name="desc[]" placeholder="desc1" /><br> <input type="file" name="files[]" multiple /><br> <input type="text" name="name[]" placeholder="name2" /><br> <input type="text" name="desc[]" placeholder="desc2" /><br> <input type="file" name="files[]" multiple /><br> How to create an array with the names of the files that were selected in the first or second input. There is a script almost working, but it has a defect that instead of the file name there is a hieroglyph
$this_is_it = array(); $post = array_values($_POST); for($j = 0; $j < count($post[1]); $j++){ for($u = 0; $u < count($post[3]); $u++){ $this_is_it['order_' . ($j + 1)] = array( 'name' => $post[1][$j], 'desc' => $post[2][$j], 'attach' => $post[3][$j] ); } } It displays with this:
array(2) { ["order_1"]=> array(3) { ["name"]=> string(4) "lala" ["desc"]=> string(7) "lalalal" ["attach"]=> string(1) " " } ["order_2"]=> array(3) { ["name"]=> string(5) "name2" ["desc"]=> string(5) "desc2" ["attach"]=> string(1) " " } } What to do how to be