In PHP you can use WordPress function do_shortcode()
Example:
<?php echo do_shortcode('[cf_geo return="city"]'); ?>
or directly using PHP class:
<?php if(class_exists("CF_Geoplugin")){ // include plugin class $cf_geo = new CF_Geoplugin; // get data $geo = $cf_geo->get(); // print data echo $geo->city; } ?>
You are free to decide what method is best for you to use.
Later you can use data like:
<?php $country = strtoupper($geo->country_code); if(in_array($country, ['US','UK']) !== false) echo 'Hello World'; else if(in_array($country, ['DE','GB']) !== false) echo 'Hallo Wereld'; else echo 'Hakuna Matata'; ?>