How to easily consume a web service through REST on PHP

Example: We need to get the ISO country code which is for Germany = DE. If you access to the site http://services.groupkt.com/country/search?text=Germany you will see what this returns. You can change the part of the array ‘alpha2_code’ to one of the others