gpt4 book ai didi

PHP:将长查询字符串拆分为多行

转载 作者:行者123 更新时间:2023-12-02 05:06:32 39 4
gpt4 key购买 nike

我有一个很长的字符串,我想将其分成多行,以便更容易阅读。但我不确定语法是什么

$xml = array('sXML' =>"<queryxml><entity>Ticket</entity><query><field>Status<expression op=\"$condition1\">$complete</expression></field><condition operator=\"AND\"><field>AccountID<expression op=\"equals\">$userid</expression></field></condition><condition operator=\"AND\"><condition><field>QueueID<expression op=\"NotEqual\">$routine</expression></field></condition><condition operator=\"OR\"><field>QueueID<expression op=\"NotEqual\">$recurring</expression></field></condition><condition operator=\"OR\"><field>QueueID<expression op=\"NotEqual\">$clientmanagement</expression></field></condition></condition></query></queryxml>");

有人可以帮我吗?

最佳答案

只需将其拆分为多个字符串并将它们连接起来,如下所示:

$xml = array('sXML' => "lorem" .
"ipsum" .
"dolor");

或使用heredoc :

$sXML = <<<XML
your text
goes here
XML;

$xml = array('sXML' => $sXML);

关于PHP:将长查询字符串拆分为多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3717781/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com