in my POST variable i have: print_r($_POST["partecipanti"]);
It displays
["1", "2"]
I want to save only the numbers of the post variable in an int array. I tried
$array = array();
preg_match_all('/-?\d+(?:\.\d+)?+/', $_POST["partecipanti"], $array);
But print_r($array) returns
Array (
[0] => Array (
[0] => 1
[1] => 2
)
)
How can i have a variable like
Array (
[0] => 1
[1] => 2
)
Hope i explained good, thanks all in advance