Various parts of the PHP language are represented internally by tokens. ... The following table lists all tokens. They are also available as PHP constants.
it prints them as data1\tdata2\tdata3\n... How can I get php to read \t and \n as tab and new line? ... "\t" not '\t', php doesnt escape in single quotes.
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML...
You can create a string in PHP by enclosing a sequence of characters in either single or double quotes. PHP will actually interpret the following strings differently
{"2_cerg":{"state":{"logo":{"href":"//yandex.com.tr","isForeign":true},"form":{"action":"/search/","searchLabel":"Bul","hiddenInputs":[{"name":"lr","value":20815}]},"actions":{"advancedSearch":{"checked":false,"ariaLabel":"Gelişmiş arama"},"moreButtonProps":{"ariaLabel":"Daha fazla"},"cbir":{"name":"cbir","label":"Görsele göre arama","infoUrl":"//yandex.ru/promo/photosearch/index?source=landingdesk","isMacOS":false}},"userSection":{"loggedIn":false,"loginProps":{"loginUrl":"https://passport.yandex.com.tr/auth?retpath=%2F&origin=serp_desktop_auth_new","loginText":"Giriş yap","burgerAriaLabel":"Menü"}},"navigation":{"tabs":[{"id":"www","label":"Arama","url":"//yandex.com.tr","params":{"source":"tabbar"},"target":""},{"id":"images","label":"Görsel","url":"//yandex.com.tr/gorsel/search","params":{"text":"[$query]","noreask":"[$noreask]","nomisspell":"[$nomisspell]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"video","label":"Video","url":"//yandex.com.tr/video/search","params":{"text":"[$query]","noreask":"[$noreask]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"maps","label":"Haritalar","url":"//yandex.com.tr/harita","params":{"text":"[$query]","source":"serp_navig"}},{"id":"translate","label":"Çeviri","url":"//ceviri.yandex.com.tr","params":{"text":"[$query]","from":"tabbar"}}],"selectedTabId":"www"},"context":{"query":"t php","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","noreask":"1","lr":"20815","counters":{"type":"b","data":{"$header":"0_3jffz000","logo":"0_3jffz001","login":"0_3jffz003","usermenu":"0_3jffz004","market-cart":"0_3jffz006","more-button":"0_3jffz007","cbir":"0_3jffz008","$navigation":"0_3jffz009","item":"0_3jffz00i","tab-www":"0_3jffz00b","tab-images":"0_3jffz00d","tab-video":"0_3jffz00f","tab-maps":"0_3jffz00h","tab-translate":"0_3jffz00j"}}},"loggedIn":false,"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"0_3jffw01-0-1"},"ui":"desktop","service":"web","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","fast":{"name":"header-desktop"}}}}},"type":"header-desktop"},"2_3jff0":{"state":{"advAjax":{"subtype":"premium_ajax","shown":"eyJwcmVtaXVtIjpbXX0="},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_3jffw0b-0-1"},"ui":"desktop","service":"web","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","fast":{"name":"adv","subtype":"return_ajax"}}}}},"type":"adv","subtype":"return_ajax"},"2_3jff1":{"state":{"answersUrl":"https://stackoverflow.com/questions/16066614/how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters#answers","type":"fact","tabsOptions":[{"id":"question","text":"Soru"},{"id":"bestAnswer","text":"En iyi yanıt"},{"id":"moreAnswers","text":"4 yanıt daha","shortText":"Daha fazla"}],"tabContents":{"question":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"I'm trying to output the data in my php file as plain text and I want the output to have a table format like this:"}]},{"type":"code","content":[{"type":"text","content":[{"type":"text","content":"data1 data2 data3"}]},{"type":"text","content":[{"type":"text","content":"1 a b"}]},{"type":"text","content":[{"type":"text","content":"2 c d"}]},{"type":"text","content":[{"type":"text","content":"...."}]}]},{"type":"paragraph","content":[{"type":"text","content":"When i try this:"}]},{"type":"code","content":[{"type":"text","content":[{"type":"text","content":"foreach(...)"}]},{"type":"text","content":[{"type":"text","content":"echo $data1 . '\\t' . $data2 . '\\t' . $data3 . '\\n';"}]}]},{"type":"paragraph","content":[{"type":"text","content":"it prints them as "},{"type":"code","content":[{"type":"text","content":"data1\\tdata2\\tdata3\\n..."}],"isInline":true}]},{"type":"paragraph","content":[{"type":"text","content":"How can I get php to read "},{"type":"code","content":[{"type":"text","content":"\\t"}],"isInline":true},{"type":"text","content":" and "},{"type":"code","content":[{"type":"text","content":"\\n"}],"isInline":true},{"type":"text","content":" as tab and new line?"}]}],"footerProps":{"date":1472519262,"numLiked":44,"numCommented":4}},"bestAnswer":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"put it in double quotes"}]},{"type":"paragraph","content":[{"type":"code","content":[{"type":"text","content":"echo \"\\t\";"}],"isInline":true}]},{"type":"paragraph","content":[{"type":"text","content":"See: "},{"type":"text","content":"http://php.net/language.types.string#language.types.string.syntax.double"}]}],"footerProps":{"date":1419378474,"numLiked":58,"numCommented":2}},"moreAnswers":[{"construct":[{"type":"code","content":[{"type":"text","content":[{"type":"text","content":"\"\\n\" = new line"}]},{"type":"text","content":[{"type":"text","content":"'\\n' = \\n"}]},{"type":"text","content":[{"type":"text","content":"\"\\t\" = tab"}]},{"type":"text","content":[{"type":"text","content":"'\\t' = \\t"}]}]}],"footerProps":{"date":1366206211,"numLiked":41,"numCommented":1}},{"construct":[{"type":"paragraph","content":[{"type":"code","content":[{"type":"text","content":"\"\\t\""}],"isInline":true},{"type":"text","content":" not "},{"type":"code","content":[{"type":"text","content":"'\\t'"}],"isInline":true},{"type":"text","content":", php doesnt escape in single quotes"}]}],"footerProps":{"date":1411867838,"numLiked":6,"numCommented":0}}]},"organic":{"faviconProps":{"src":"https://favicon.yandex.net/favicon/v2/https://stackoverflow.com","size":"m","pageNumber":0,"index":0},"title":"How to make \u0007[php\u0007] display \\\u0007[t\u0007] \\n as tab and new line instead of characters [closed]","pathProps":{"items":[{"url":"https://stackoverflow.com/questions/16066614/how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters","text":"stackoverflow.com"},{"url":"https://stackoverflow.com/questions/16066614/how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters","text":"how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters"}]},"faviconPosition":0,"subtitlePosition":1,"linkProps":{"url":"https://stackoverflow.com/questions/16066614/how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters"},"hostTitle":"Stackoverflow.com","description":"stackoverflow.com › how-to-make-php-display-t-n-as-tab-and-new-line-instead-of-characters"},"extralinksProps":{"hidden":true,"directions":["bottom-end"],"items":[{"variant":"reportFeedback","reportFeedback":{"feature":"Блок ответов для разработчиков","title":"Bu yanıtta yanlış olan nedir?","checkBoxLabels":[{"value":"Yanıt sorguya uygun değil"},{"value":"Yanıt hatalı"},{"value":"Yanıttaki bilgiler eksik"},{"value":"Diğer"}]}}]},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_3jffw0d-0-1"},"ui":"desktop","service":"web","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","fast":{"name":"article"}}}}},"type":"article"},"2_3jff2":{"state":{"linksGroups":[{"type":"geo","links":[{"label":"Columbus","title":"Columbus","url":"//yandex.com.tr/tune/geo","logNode":{"name":"region"},"target":"_self","a11yLabel":"Bölgeniz Columbus","needRetpath":true}]},{"type":"feedback","links":[{"label":"Hata bildir","logNode":{"name":"feedback","attrs":{"behaviour":{"type":"dynamic"}}}}]},{"type":"settings","links":[{"label":"Ayarlar","url":"//yandex.com.tr/tune/search","logNode":{"name":"settings"},"target":"_self","needRetpath":true}]},{"type":"company","links":[{"label":"Hakkımızda","url":"https://company.yandex.com.tr","logNode":{"name":"about"},"target":"_blank"},{"label":"Ticari teklifler","url":"/search/direct?text=t%20php&filters_docs=direct_cm","logNode":{"name":"commercial"},"target":"_blank"},{"label":"Kariyer","url":"//yandex.com.tr/jobs/?utm_source=serp_turkie&utm_medium=footerlink&utm_content=career","logNode":{"name":"vacancy"},"target":"_blank"},{"label":"Kullanım lisansı","url":"//yandex.com.tr/legal/termsofuse/","logNode":{"name":"license"},"target":"_blank"},{"label":"Gizlilik Politikası","url":"//yandex.com.tr/legal/confidential/","logNode":{"name":"confidential"},"target":"_blank"}],"a11yHidden":true}],"reportFeedbackProps":{"feature":"Подвал","title":"Hata bildir","checkBoxLabels":[]},"isSearchApp":false,"hasExtralinks":true,"limitingSelector":".AliceFabButton","baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_3jffw0e-0-1"},"ui":"desktop","service":"web","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL"}}}},"type":"serp-footer"},"2_3jff3":{"state":{"conditionLoadList":{"marketCart":false,"highchartsHighstock":false,"advProductGallery":false,"musicPlayer":false,"ecomRates":false,"photoViewer":false,"easterEggModal":false,"easterEggPlusGamesModal":false,"futurisFeedbackLoader":false,"darkmodeChangeDrawer":true},"reportFeedbackBaseProps":{"initEmail":"","metaFields":{"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","userTestids":"1111484,1066210,186144,1060139,1107403,1120431,1125212,1118064,1116728,1121242,992985,754550,1115752,1089203,1113828,1118708,1125840,1118397,1121288,1117318,1120717,187288,66186,1085698,1120008,1114943,1113499,1119144,1122716,1112119,1090434,1120929,658770,364898,1111779,1120060,1105751,260564,1122221,1098102,1107795,1125106,1122165,1113733,1121522,1120633,1113483,1119850,1002325,1119699,1115034,45973,151171,126318,126350,1118479,287509,142431,338390,1006026,1122266,1122920,1111984,1111509,1114329,1126215,1082996,1087742","yandexuid":"9188981811727783063","uid":"0","queryText":"t php","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","searchSlices":["drawer_search_slice_cs"],"userRegionName":"Columbus","userRegionId":"20815","isChildAccount":false}},"extralinksPopupProps":{"abuseLink":"https://twitter.yandex.com.tr/search/abuse?sign=d278f825e13523738cff6204957aa425&keyno=0"},"isLoggedIn":false,"userMenuDialogProps":{"flag":"skin,feedback","host":"yandex.com.tr","lang":"tr","project":"serp","queryParams":{"utm_source":"search"},"retpath":"https%3A%2F%2Ftwitter.yandex.com.tr%2Fsearch%2F%3Flr%3D20815%26noreask%3D1%26rq%3D1%26serp-reload-from%3Drec_bottom%26text%3Dt%2Bphp%26ncrnd%3D41720","tld":"com.tr"},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_3jffw0f-0-1"},"ui":"desktop","service":"web","reqid":"1727783063234438-10331615319218898181-balancer-l7leveler-kubr-yp-sas-141-BAL","fast":{"name":"lazy-load"}}}}},"type":"lazy-load"}}