The checkbox element in HTML allows us to select multiple items from the group of values.
When you use it in your form and try to read all checked values as any other elements like – text box, text area, radio button etc.
echo $_POST['lang']; // Checkbox element
you will get the last checked value.
You need to send the checkboxes value in the form of an Array when the form gets submitted then you can loop over $_POST values.