各位老大,帮忙检查一下语法吧,关于引号的用法,难煞小弟!
我打算用PHP输出一段 XML,有一句总是出错,语法不对!
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->$strXML .= "<set name='"date_format($row["DatePro"],'%Y-%m')"' value='".$row["Quantity"]."' hoverText='' />";
date_format($row["DatePro"],'%Y-%m') 这个两边少了连接符 <br><font color="#e78608">------解决方案--------------------</font><br>$strXML .= "<set name='" . date_format($row["DatePro"],' . value='" . $row["Quantity"] . "' hovertext=""></set>";<br><br><font color="#e78608">------解决方案--------------------</font><br>date_format对于参数,是有格式要求的,,你翻手册<br><br><br>可以尝试下,date_format(date_create($row["DatePro"]),'%Y-%m') <br><font color="#e78608">------解决方案--------------------</font><br>date_format 的第一个参数应该是 DateTime 类型数据 <br><font color="#e78608">------解决方案--------------------</font><br>我看了下函数说明,加上$date = date_create($xxx); 看看 ,前面1万米已经说了<br><br><font color="#e78608">------解决方案--------------------</font><br>
strtotime("Y-m-d H:i:s")//输出时间戳格式
date("Y-m-d H:i:s",time())//把时间戳格式输出成2011-02-1 12:0:0 格式 <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号