Skip to content

Instantly share code, notes, and snippets.

@Omranic
Last active December 11, 2016 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Omranic/573b815c28b243c0065b7786e3014617 to your computer and use it in GitHub Desktop.
Save Omranic/573b815c28b243c0065b7786e3014617 to your computer and use it in GitHub Desktop.
Code sample for rinvex/country package
<?php
// Get single country
$egypt = country('eg');
// Get country name // Get country native name
echo $egypt->getName(); echo $egypt->getNativeName();
// Get country official name // Get country ISO 3166-1 alpha2 code
echo $egypt->getOfficialName(); echo $egypt->getIsoAlpha2();
// Get country area // Get country borders
echo $egypt->getArea(); echo $egypt->getBorders();
// Get country currencies // Get country languages
echo $egypt->getCurrencies(); echo $egypt->getLanguages();
// Get country emoji // Get country flag
echo $egypt->getEmoji(); echo $egypt->getFlag();
// Get all countries
$countries = countries();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment