将nad27数据转换为nad83的函数

How can I take a NAD27 decimal coordinate like 39.748303,-104.998634 and convert it to NAD83 or WGS84 with a programming function in PHP or JS?

I know it can be done with GIS programs, but I need a programming function ideally in PHP, but I could convert from any language.

I would recommend proj4js. Lightweighted projection library https://github.com/proj4js/proj4js,

Let me know if that helps.

    var NAD2NAD = function(x,y){
    var NAD27= "+proj=longlat +ellps=WGS84 +datum=NAD27 +no_defs"; 
    var NAD83= "+proj=longlat +ellps=WGS84 +datum=NAD83 +no_defs";
    return proj4(NAD27,NAD83,[x,y]);
};

your input in NAD27 39.748303,-104.998634,

Proj4js returns in datum NAD83 [ -104.998634, 39.74619740515981 ],

From http://tagis.dep.wv.gov/convert/ Result is 39.748289809487346 -104.99917122555918

i made the assumption that ellps value unchanged without knowing what extact projection your data is in.