|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-07 22:33 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 00:00:02 2025 UTC |
Description: ------------ Using an "Escape" \ in certain quotes, results in literal translation. Tested on \r \n \t inside Single and Double quotes. Single Quotes does not escape. Double Quotes escapes. I can not find documentation to explain this behaviour, or warnings on pages, related to places where one might try to use an escape. Processed all Escapes inside any single ' and double " quotes. or... {Possible feature request} SingleQuoteEscape=(all|none|quotes) DoubleQuoteEscape=(all|none|quotes) All = \r \n \t \\ \' {\"} None = literal quoted text, must use CHR strings (Iso), No like-quotes allowed. Quotes = if {'} then \' escape, if {"} then \" escape Reproduce code: --------------- <? $MyString1 = '\tTest1\r\nABC1'; $MyString2 = "\tTest2\r\nABC2"; echo($MyString1.'<BR>'.$MyString2.); ?> Expected result: ---------------- Expected Output: Test1 ABC1 Test2 ABC2 Actual result: -------------- Actual Output: \tTest1\r\nABC1 Test2 ABC2