Skip to content

TechXcel.com - provides technical excellence...

Narrow screen resolution Wide screen resolution Increase font size Decrease font size Default font size default color orange color green color
You are here: Home arrow PHP arrow Printable Document Generation with PHP
Printable Document Generation with PHP PDF Print E-mail
(7 votes)
Written by Chetankumar Akarte   
Tuesday, 13 March 2007
Article Index
Printable Document Generation with PHP
Advantages of RFT Format
1. Generate Template
2. Open template in PHP
3. Modifying contents
4. Save Document
Download Source Code

Open the template document in PHP



Now the Template document has been generated. The next process is simply a matter of opening the template from within a PHP script and making the necessary modifications. To open our file using php we are using primary file-access function the fopen() function. The formal syntax of the fopen() function is as follows:
fopen(string $filename, string $mode [, boolean $use_include_path ])
$filename represents the filename to open, $mode represents the "mode" under which the fopen() function is opening the file (see Table 1), and $use_include_path is a Boolean value that indicates whether the file should be looked for in the PHP include path. The fopen() function then returns a "reference" to the opened file, which is used when working with other file system functions, or returns false if the fopen() call fails.

Table 1 Modes supported by fopen()
r Open the file for reading.
r+ Open the file for reading and writing.
w Open the file for writing, overwriting existing files, and creating the file if it does not exist.
w+ Open the file for reading and writing, overwriting existing files, and creating the file if it does not exist.
a Open the file for writing, creating the file if it does not exist, and appending to the file if it does.
a+ Open the file for reading and writing, creating the file if it does not exist, and appending to the file if it does.
b Open the file in binary reading/writing mode (applicable only on Windows systems; however, recommended in all scripts).




Last Updated ( Tuesday, 04 September 2007 )
 

Who's Online

We have 1 guest online

User Login

PayPal Donation

Enter Amount:

Syndicate

TechXcel's Friends

Tutorials Garden
Wicolorz
pixel2life

Text Link Add

Statistics

Members: 276
News: 60
Web Links: 6
Visitors: 348396

Google Seach

Google AdSense

TechXcel Referrals

TechXcel's Sponcer...