Re: Re: Lining up items on page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 29, 2014 at 11:52 PM, Jim Giner <jim.giner@xxxxxxxxxxxxxxxxxx>
wrote:

> On 7/29/2014 11:36 PM, Ethan Rosenberg wrote:
>
>> Dear list -
>>
>> I wish to align my output.
>>
>> An example-
>>
>> fprintf($fptr1, "%s\t %s\t\n", $row1[0],$row1[1]);
>>
>> In each row of output if the strings are wider than the tab setting, the
>> text will indent.
>>
>> Is there anyway I can formulate the fprinf so that each string will
>> print at a specific place?
>>
>> TIA
>>
>> Ethan
>>
>>  Why not use a table?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
If you know that the upper limit of the strings you can do:

echo sprintf("%-30s %s", $row1[0],$row1[1]);

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux