I need to send an id to the page, I got to this solution:
<? $post['id'] = 1; ?> <form method="POST" action="./post.php"> <input type="submit" class="btn btn-info btn-sm" name="<?echo $post['id'];?>" value="Прочесть польностью"/> </form>
Then I get id in this way:
$id_post = array_keys($_POST)[0];
I get such an array
Array ( [1] => Прочесть польностью )
In the array, my value is $post['id'] as the key and the button's label as value.
How can I get a $_POST this format?
Array ( [id] => 1 )