I have an array $_POST['form']['clima']
which in this example has the value below
array(2){
[0]=> string(1) "1"
[1]=> string(1) "2"
}
I need to get these values to join with $ id (in this example it will be 3) to bring the result below ($ id, value of each array):
(3, 1),
(3, 2)
How can I do this?
I tried this, but repeated the value 2:
$id = 3;
foreach($_POST['form']['clima'] as $clima){
$todos = '('.$id.','.$clima.')';
$todos.=','.$todos;
}
Result of what I did:
(3,2),(3,2)