Skip to content

Instantly share code, notes, and snippets.

@samhk222
Created August 1, 2022 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samhk222/4567f9173318814ce2efc259e1088704 to your computer and use it in GitHub Desktop.
Save samhk222/4567f9173318814ce2efc259e1088704 to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include("vendor/autoload.php");
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$array_filtrado = array_filter($_POST['proj'], function ($item) {
return $item['vinculo_tal'] != "";
});
dd($array_filtrado);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action="?" method="POST">
<?php
$i = 0;
do {
?>
<input type="hidden" name="proj[<?php echo $i; ?>][escondidin]" value="<?php echo $i; ?>">
<input type="text" name="proj[<?php echo $i; ?>][vinculo_tal]">
<input type="text" name="proj[<?php echo $i; ?>][outro_campo]">
<br>
<?php
$i++;
} while ($i <= 5)
?>
<input type="submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment