With Ireland soon to be moving to ITM (Irish Transverse Mercator) coordinates, over IG (Irish Grid) that has been used since about 1965 in Ireland, many websites – including Geograph.ie and nearby.org.uk will be looking to support ITM coordinates – even if they still use Irish Grid.
Grab the class from Geograph SVN (or even better do a SVN checkout!) and put it somewhere safe. (but you will probably want to remove the “extends Conversions” bit from the definition – we use that for convience in Geograph source)
Then can just use it
$conv = new ConversionsLatLong; list($lat,$lng) = $conv->itm_to_wgs84($e,$n);
But as we already use the same code for Irish Grid, and OSGB36 British National Grid, can also use it for them, and even IG< ->ITM conversion
list($lat,$lng) = $conv->itm_to_wgs84($e,$n); list($lat,$lng) = $conv->irish_to_wgs84($e,$n,true); list($lat,$lng) = $conv->osgb_to_wgs84($e,$n); list($e,$n) = $conv->wgs84_to_itm($lat,$lng); list($e,$n) = $conv->wgs84_to_irish($lat,$lng,true); list($e,$n) = $conv->wgs84_to_osgb36($lat,$lng); //even a short convience function to create a 10 figure grid reference $gr10 = $conv->osgb36_to_gridref($e,$n);