duanhan9334 2011-09-09 18:10
浏览 36
已采纳

换行插入文件的开头

I have code that generates a Google KML feed on my primary production server that works fine. When I copy it to the secondary production mirror, there's a newline at the beginning of the file. Everything else works fine. Would anyone happen to know which configuration options could possibly force a newline to be the first character of a file being created?

Code to generate the file:

header('Content-type: application/vnd.google-earth.kml+xml');
header('Content-Disposition: attachment; filename="My KML.kml"');
echo '<?xml version="1.0" encoding="UTF-8"?>
' .
     '<kml xmlns="http://earth.google.com/kml/2.2">
' .
     '(The rest of the KML code)';
  • 写回答

1条回答 默认 最新

  • duanlu0386 2011-09-10 04:17
    关注

    Most likely the file is being included from another file which has an extra carriage return at the bottom. Find the file with the extra carriage return and you will find the culprit.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Android STD快速启动
  • ¥15 如何使用simulink建立一个永磁同步直线电机模型?
  • ¥30 天体光谱图的的绘制并得到星表
  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动