This code will return an array with the names of selected countries. You can use that array for the operations you need: either display them in your html, or send them to your server through a php file
<!--jQuery-->
$(function() {
$("#btn-paises").click( function()
{
var arrPaises = $('input[name="paises"]:checked').map(function()
{
return $(this).val();
}).get();
console.log(arrPaises);
alert(arrPaises);
});
});
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<p>Países visitados:</p>
<label><input type="checkbox" id="cbox1" name="paises" value="Brasil"> Brasil</label><br>
<label><input type="checkbox" id="cbox2" name="paises" value="México"> México</label><br>
<label><input type="checkbox" id="cbox3" name="paises" value="Colombia"> Colombia</label><br>
<button id="btn-paises">Enviar Países</button>
<div id="datos"></div>
Example of result:
You will obtain an array with the values of the selected checkboxes, with which you can operate for your needs.
["Brasil", "México"]
Reading the values of the array is very easy, for example:
$.each(arrPaises, function (k, v) {
console.log('País: '+v);
});
The name of each country will have the value v inside the loop.
If you want to send it to the server through PHP you can pass the complete array, without reading it, to your PHP.
It is a clean and orderly way to proceed. Everything will depend on your needs.