Encoding newlines in iCal files

后端 未结 7 1788
别那么骄傲
别那么骄傲 2020-12-14 05:41

I\'m trying to figure out how to encode newlines in the DESCRIPTION part of an iCal file in such a way that they will import properly into Outlook, Google Calendar and the A

7条回答
  •  醉梦人生
    2020-12-14 06:07

    I had to escape the output in the string to set a literal "\n" in the output file. Like so. Worked a charm.

    $events .= "DESCRIPTION:" . str_replace("\n","\\n",str_replace(";","\;",str_replace(",",'\,',get_event_contents()))) . "\n";
    

提交回复
热议问题