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.

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

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统