Gene, about a year ago a wrote a PHP program to grab the data from an Ambient ObserverIp and post the data to CWOP. This is an extract from that program. Hope this help.
// FW0717>APRS,TCPXX*:/241505z4220.45N/07128.59W_032/005g008t054r001p078P048h50b10245e1w
// in above TCPXX is no longer used, should be TCPIP
$APRSdata =""; //Make sure we start clean
$APRSdata = "FW0717"; // CWOP ID or callsign
$APRSdata = $APRSdata . ">APRS,TCPIP*:"; // network type
$APRSdata = $APRSdata . "@".date('his'); //time since midnight
// $APRSdata = $APRSdata . "@".$time; // time of report
$APRSdata = $APRSdata . "z3008.75N/09524.78W"; // lat long - put yours in here like "9900.00N/00099.00E"
$APRSdata = $APRSdata . "_".$ave_wind_dir; //Wind direction in degrees
$APRSdata = $APRSdata . "/".$ave_wind_speed; //Wind speed in mph
$APRSdata = $APRSdata . "g".$wind_gust; //Windgust in mph
$APRSdata = $APRSdata . "t".otempf (); //Outside temp
$APRSdata = $APRSdata . "r".LRain (); //rain in hour. Actually this is rain rate
$APRSdata = $APRSdata . "p".DRain (); // doesn't have rain in last 24 hours. Maybe a project for later
$APRSdata = $APRSdata . "P".DRain (); //Rain since midnight
$APRSdata = $APRSdata . "h".Humidity1 (); //Humidity
$APRSdata = $APRSdata . "b".Pressure (); //Barometric presure
$APRSdata = $APRSdata . "L".Solar (); //Solar radiation
$APRSdata = $APRSdata . "Weather logger V3.1.0"; //My information
//write the CWOP data to a file for testing
// file_put_contents('.\CWOP.txt', $APRSdata . PHP_EOL,FILE_APPEND); //un-comment when writing to data file