TIDY_REPAIR_FILE(3) 1 TIDY_REPAIR_FILE(3)tidy::repairFile - Repair a file and return it as a string
Object oriented style
SYNOPSIS
string tidy::repairFile (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
DESCRIPTION
Procedural style
string tidy_repair_file (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
Repairs the given file and returns it as a string.
PARAMETERS
o $filename
- The file to be repaired.
o $config
- The config $config can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the
configuration file, otherwise, it is interpreted as the options themselves. Check http://tidy.sourceforge.net/docs/quickref.html
for an explanation about each option.
o $encoding
- The $encoding parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0,
latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5, and shiftjis.
o $use_include_path
- Search for the file in the include_path.
RETURN VALUES
Returns the repaired contents as a string.
EXAMPLES
Example #1
tidy_repair_file(3) example
<?php
$file = 'file.html';
$tidy = new tidy();
$repaired = $tidy->repairfile($file);
rename($file, $file . '.bak');
file_put_contents($file, $repaired);
?>
NOTES
Note
The optional parameters $config and $encoding were added in Tidy 2.0.
SEE ALSO tidy.parseFile(3), tidy.parseString(3), tidy.repairString(3).
PHP Documentation Group TIDY_REPAIR_FILE(3)
Check Out this Related Man Page
TIDY.REPAIRFILE(3) 1 TIDY.REPAIRFILE(3)tidy::repairFile - Repair a file and return it as a string
Object oriented style
SYNOPSIS
string tidy::repairFile (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
DESCRIPTION
Procedural style
string tidy_repair_file (string $filename, [mixed $config], [string $encoding], [bool $use_include_path = false])
Repairs the given file and returns it as a string.
PARAMETERS
o $filename
- The file to be repaired.
o $config
- The config $config can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the
configuration file, otherwise, it is interpreted as the options themselves. Check http://tidy.sourceforge.net/docs/quickref.html
for an explanation about each option.
o $encoding
- The $encoding parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0,
latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5, and shiftjis.
o $use_include_path
- Search for the file in the include_path.
RETURN VALUES
Returns the repaired contents as a string.
EXAMPLES
Example #1
tidy.repairFile(3) example
<?php
$file = 'file.html';
$tidy = new tidy();
$repaired = $tidy->repairfile($file);
rename($file, $file . '.bak');
file_put_contents($file, $repaired);
?>
NOTES
Note
The optional parameters $config and $encoding were added in Tidy 2.0.
SEE ALSO tidy.parseFile(3), tidy.parseString(3), tidy.repairString(3).
PHP Documentation Group TIDY.REPAIRFILE(3)
Hi Friend,
I have a small script to list all file FFAAAAABBBBB00001 and FFAAAAABBBBB00001.repaired (when I run another script, the orginal file will output another *.repaired file) in my unix directory, and reaname the output file FFAAAAABBBBB00001.repaired back to FFAAAABBBBB00001. However, it... (2 Replies)
Preparing for a move to a new server, I needed to offload about somewhat over a gigabyte of newsfeeds that my website collects, and that I had been saving on the server. I tarred them and zipped them into about a dozen smaller files of about 150Mb each. All seemed well. I downloaded them onto my... (3 Replies)
Hi All,
I have unplumbed one interface.
after that ifconfig -a shows that
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
... (7 Replies)
Hello,
I have a CSV-like dataset where some of the columns contain HTML snippets which I need to convert to XHTML. For any given snippet, I have a functioning config for the text processor 'tidy' such that
tidy -config tidy.cfg example.html
does the job I need done.
I would like to process... (10 Replies)