tidy::parseFile

tidy_parse_file

(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2)

tidy::parseFile -- tidy_parse_fileParse markup in file or URI

Beschreibung

Objektorientierter Stil

public tidy::parseFile(
    string $filename,
    array|string|null $config = null,
    ?string $encoding = null,
    bool $useIncludePath = false
): bool

Prozeduraler Stil

tidy_parse_file(
    string $filename,
    array|string|null $config = null,
    ?string $encoding = null,
    bool $useIncludePath = false
): tidy|false

Parses the given file.

Parameter-Liste

filename

If the filename parameter is given, this function will also read that file and initialize the object with the file, acting like tidy_parse_file().

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.

For an explanation about each option, see » http://api.html-tidy.org/#quick-reference.

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.

useIncludePath

Search for the file in the include_path.

Rückgabewerte

tidy::parseFile() returns true on success. tidy_parse_file() returns a new tidy instance on success. Both, the method and the function return false on failure.

Changelog

Version Beschreibung
8.0.0 config and encoding are nullable now.

Beispiele

Beispiel #1 tidy::parseFile() example

<?php
$tidy 
= new tidy();
$tidy->parseFile('file.html');

$tidy->cleanRepair();

if(!empty(
$tidy->errorBuffer)) {
    echo 
"The following errors or warnings occurred:\n";
    echo 
$tidy->errorBuffer;
}
?>

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

What defines Laravel's developer community?

Wenn Sie Ihr eigenes soziales Netzwerk erstellen möchten, empfehle ich Ihnen, den Blog zu lesen, in dem alles beschrieben ist https://merehead.co ...

Geschrieben von jord2 am 02.05.2024 13:44:45
Forum: PHP Developer Forum
Ich bin am verrückt werden - Session und neue Webseite

That is an extremely bright idea

Geschrieben von EssaMattou am 02.05.2024 09:34:57
Forum: SQL / Datenbanken
"Why adore HTMX over JavaScript?"

What specific features or aspects of HTMX, a library designed to enhance interactions in web applications, appeal to users who have a strong affin ...

Geschrieben von WartanThamar am 02.05.2024 06:53:08
Forum: HTML, JavaScript, AJAX, jQuery, CSS, Bootstrap, LESS