Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

constant like PHP_EOL for tabulation php

Tags:

php

tabs

eol

Please help, how can i find the constant like PHP_EOL for tabulation My code wrote file which has a lot of generated tabulations and new lines new lines wrote correctly, but i have a lot of "\t\t" see example:

common.app \t/loader \t/growl \t\t/error \t/form
like image 840
Andrzej Moroz Avatar asked Sep 19 '16 10:09

Andrzej Moroz


2 Answers

Ok I found solution

chr(9) wrote tabulation to output file

Thanks!

like image 103
Andrzej Moroz Avatar answered Nov 18 '22 02:11

Andrzej Moroz


PHP_EOL is a Constant from Core PHP. You could simply define your own Constants and use them. For example:

<?php

    defined("TAB1") or define("TAB1", "\t");
    defined("TAB2") or define("TAB2", "\t\t");
    defined("TAB3") or define("TAB3", "\t\t\t");
    defined("TAB4") or define("TAB4", "\t\t\t\t");
    defined("TAB5") or define("TAB5", "\t\t\t\t\t");


    $string = "common.app"     . TAB1 . "/loader" . TAB1 . "/growl" . 
               TAB2 . "/error" . TAB1 . "/form";
like image 5
Poiz Avatar answered Nov 18 '22 03:11

Poiz