top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Lining up items on page using PHP

+1 vote

I wish to align my output.

An example-

fprintf($fptr1, "%st %stn", $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?

posted Jul 30, 2014 by Ramakrishnan

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I have a page where the user can select a few products, then I have a database PHP MySQL query that selects recent purchases of those products and also where they were purchased from like:

- query... select widget1 - widget2 and widget3


widget1, invoice 51, sold from store 1
widget1, invoice 72, sold from store 2
widget1, invoice 59, sold from store 1

widget2, invoice 2, sold from store 2
widget2, invoice 81, sold from store 1

widget3, invoice 201, sold from store 1
widget3, invoice 151, sold from store 2
widget3, invoice 17, sold from store 2
widget3, invoice 3, sold from store 1

I would like to generate report that can do some summary functions, so that the output report looks something like:



widget1, invoice 51, more fields here
widget1, invoice 59, more fields here
widget2, invoice 81, more fields here
widget3, invoice 201, more fields here
widget3, invoice 3, more fields here


widget1, invoice 72, more fields here
widget2, invoice 2, more fields here
widget3, invoice 151, more fields here
widget3, invoice 17, more fields here

I am curious how to construct the php to be able to simulate this 'STORE SUMMARY' on the report page. Any ideas are welcome.

+1 vote

Something that just sends a screen directly to the printer without having to involve Notepad or the like? I am unable to find a search function on the updated Yahoo group.

0 votes

Is print thread safe? That is, if I have two threads that each call print, say:

print "spam spam spam" # thread 1
print "eggs eggs eggs" # thread 2

I don't care which line prints first, but I do care if the two lines are mixed in together, something like this:

spam spaeggs eggs m seggspams

Does print perform its own locking to prevent this?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.