- // avoid using standard conversion of float to string because it is locale-dependent,\r
- // and also because the xmlrpc spec forbids exponential notation\r
- // sprintf('%F') would be most likely ok but it is only available since PHP 4.3.10 and PHP 5.0.3.\r
- // The code below tries its best at keeping max precision while avoiding exp notation,\r
- // but there is of course no limit in the number of decimal places to be used...\r
- $rs.="<${typ}>".preg_replace('/\\.?0+$/','',number_format((double)$val, 128, '.', ''))."</${typ}>";\r
+ // avoid using standard conversion of float to string because it is locale-dependent,\r
+ // and also because the xmlrpc spec forbids exponential notation\r
+ // sprintf('%F') would be most likely ok but it is only available since PHP 4.3.10 and PHP 5.0.3.\r
+ // The code below tries its best at keeping max precision while avoiding exp notation,\r
+ // but there is of course no limit in the number of decimal places to be used...\r
+ $rs.="<${typ}>".preg_replace('/\\.?0+$/','',number_format((double)$val, 128, '.', ''))."</${typ}>";\r
+ break;\r
+ case $GLOBALS['xmlrpcDateTime']:\r
+ if (is_string($val))\r
+ {\r
+ $rs.="<${typ}>${val}</${typ}>";\r
+ }\r
+ else if(is_a($val, 'DateTime'))\r
+ {\r
+ $rs.="<${typ}>".$val->format('Ymd\TH:i:s')."</${typ}>";\r
+ }\r
+ else if(is_int($val))\r
+ {\r
+ $rs.="<${typ}>".strftime("%Y%m%dT%H:%M:%S", $val)."</${typ}>";\r
+ }\r
+ else\r
+ {\r
+ // not really a good idea here: but what shall we output anyway? left for backward compat...\r
+ $rs.="<${typ}>${val}</${typ}>";\r
+ }\r