Created
April 15, 2020 16:17
-
-
Save jesders/1a3155dd2c5eb7d0a7c36f81993af2f1 to your computer and use it in GitHub Desktop.
Grab all $_POST variables and build an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$posts = array(); | |
foreach($_POST as $key => $value): | |
// if(!in_array($key, $_POST) && !empty($value)) { | |
// $posts[$key] = $value; | |
// } | |
if(!in_array($key, $_POST)) { | |
$posts[$key] = $value; | |
} | |
endforeach; | |
var_dump($posts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment