constant like PHP_EOL for tabulation php
Asked Answered
P

3

8

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
Pusey answered 19/9, 2016 at 10:13 Comment(3)
There isn't a predefined tabulation constant; but you can always define your own if you feel that it is necessaryUmberto
I define it in the code in string type But it wrote incorrectly as in examplePusey
At first I failed to see how a bunch of char(9) calls were better than \t in your code, until I realized that it was the output file that contained the literal \t. So with that in mind there has to be something wrong with the code that generates this text, so please edit your answer and post the PHP code as well.Microclimate
P
12

Ok I found solution

chr(9) wrote tabulation to output file

Thanks!

Pusey answered 19/9, 2016 at 10:23 Comment(0)
O
5

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";
Ostiole answered 19/9, 2016 at 10:19 Comment(0)
B
-6

I solved using css

<style>
.MyCSS{
    border:1px solid #FFF; 
    width:10em; 
    float:left; 
    font-weight:bold;
    }
</style>
<?php 
// here the selection query
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?>
<div>
<div class="MyCSS">
<?php stripslashes($row['Country']);?>
</div>
<?php echo stripslashes($row['CountryDescription'])."<br>";?> 
</div>
<div style="clear:both;"></div>
<?php } ?>
Brost answered 20/3, 2018 at 14:43 Comment(2)
tabulation with php using cssBrost
And this needs results from a database? Shouldn't it work without?Electrolyse

© 2022 - 2024 — McMap. All rights reserved.