首页 \ 问答 \ nl2br返回
\ r \ n,如何使所有内置的PHP函数返回\ n而不是?(nl2br returns
\r\n, how to make all built in PHP functions return \n instead?)

nl2br返回
\ r \ n,如何使所有内置的PHP函数返回\ n而不是?(nl2br returns
\r\n, how to make all built in PHP functions return \n instead?)

不要误会我的意思,我对PHP 5.3.0 xhtml <br />标签并不感到困扰,当然,我可以轻松地将\ r \ n替换为\ n。

事情是我想在这个PHP 5.3.0之前的服务器上进行某种全局设置,以使所有类似的内置PHP函数理解我要输出的HTML行之间的正确换行符是\ n,而不是\ r \ ñ。

我想要我不想要的东西吗? 这是一场不可能的梦吗? 或者我只是忘记了不可控制的常数。 这些问题没有尽头。

无论哪种方式,只是回答主题中的那个会让我高兴:)是否可能,或者我必须在构建它之后str_replace整个文章字符串。 谢谢。 顺便说一句,猫王生活。 或者至少,'生活'是'猫王'的字谜,这对我来说已经足够好,因为我不是真正的粉丝。

简而言之,我想在HTTPRESULT中为每个换行保存一个字节。


Don't get me wrong, I'm not bothered about the pre PHP 5.3.0 xhtml <br /> tags, and I can easily replace the \r\n with \n, of course.

Thing is I want some sort of global setting on this pre PHP 5.3.0 server to make all similar built in PHP functions to understand that a correct line break between the HTML lines I want to output is a \n, not a \r\n.

Do I want what I shouldn't want? Is it an impossible dream? Or did I just forget the ungooglable constant. There are no end to the questions.

Either way, just an answer to the one in subject would make me happy :) Is it possible, or do I have to str_replace the entire article string once I've built it. Thanks. BTW, Elvis lives. Or at least, 'lives' is an anagram of 'elvis' which is good enough for me since I wasn't really a fan.

In short, I want to save a byte per newline in the HTTPRESULT.


原文:https://stackoverflow.com/questions/23588405
更新时间:2022-08-26 07:08

最满意答案

简单地说, select.name = iteration2;

MDN参考


Simply, select.name = iteration2;

MDN Reference

相关问答

更多
  • 假设你的意思是当服务器到达你的php代码中的某个点时,你想要从浏览器弹出一个警报,答案是“否”。 当服务器运行你的php代码时,没有与浏览器联系(直到响应开始回来)。 在某些情况下,服务器可能会将内容流式传输回浏览器,并且在这种情况下,服务器可能会通过一些商定的约定来标记具有即时警告消息的内容流,但是我不认为这是你在这里问的。 Assuming that what you mean is that you want an alert to pop up from the browser when the s ...
  • "test": function () { return 1; } 是旧的方式和"test"() { return 1; } function关键字被忽略的新方法。 另请注意[]这里允许您使用变量作为标识符 let name = "test1" let a = { "test2": function () { return "you called test2" }, "test3"() { return "you called test3" }, [name]() { r ...
  • 使用event.target属性,它将指向当前图像对象: function drop(ev) { console.log(ev.target); // ... } Use event.target property, it will point to current image object: function drop(ev) { console.log(ev.target); // ... }
  • 首先,如果您的选择框具有ID,则会更容易。 然后你可以使用getElementById 。 var animalSelectBox = document.getElementById('animal'); alert(animalSelectBox.options[animalSelectBox.selectedIndex].value); 相反,这里是如何使用getElementsByName来做到这一点(注意这是一个复数)。 var arr = document.getElementsByName(' ...
  • 简单地说, select.name = iteration2; MDN参考 Simply, select.name = iteration2; MDN Reference
  • 问题是submit()是一个内置函数,只要提交
    就会调用它。 要提交表单的自定义功能,您不仅需要使用不同的函数名称,还要阻止使用event.preventDefault()提交默认表单,并将事件传递给函数。 这可以在下面看到 - 请注意sayHello()将清除屏幕(尝试表单提交),而customSubmit()将不会: