SplFileObject::fgetss

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::fgetssGets line from file and strip HTML tags

Warnung

Diese Funktion ist seit PHP 7.3.0 VERALTET und seit PHP 8.0.0 ENTFERNT. Von der Verwendung dieser Funktion wird dringend abgeraten.

Beschreibung

public SplFileObject::fgetss(string $allowable_tags = ?): string

Identical to SplFileObject::fgets(), except that SplFileObject::fgetss() attempts to strip any HTML and PHP tags from the text it reads. The function retains the parsing state from call to call, and as such is not equivalent to calling strip_tags() on the return value of SplFileObject::fgets().

Parameter-Liste

allowable_tags

Optional parameter to specify tags which should not be stripped.

Rückgabewerte

Returns a string containing the next line of the file with HTML and PHP code stripped, or false on error.

Beispiele

Beispiel #1 SplFileObject::fgetss() example

<?php
$str 
= <<<EOD
<html><body>
 <p>Welcome! Today is the <?php echo(date('jS')); ?> of <?= date('F'); ?>.</p>
</body></html>
Text outside of the HTML block.
EOD;
file_put_contents("sample.php"$str);

$file = new SplFileObject("sample.php");
while (!
$file->eof()) {
    echo 
$file->fgetss();
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:


 Welcome! Today is the  of .

Text outside of the HTML block.

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.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

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

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

Shop 2026 Buy Dumps Online 2026 Dumps track12+pin Best dumps website 2026

Dumps with Pin Shop Online | Clone Cards Dumps Atm | Best CVV Shop 2026 Welcome to our shop : Our store specializes in providing dumps with pin, d ...

Geschrieben von sellergood11 am 27.05.2026 22:08:28
Forum: Netzwerk &amp; Internet
@king_dumps12 SELL CC cvv GOOD &FRESH DUMPS/TRACK/WU TRANFER/PAYPAL/SHIP

------------------ Hello All Customer----------------------- _I’m sell cvv privated worldwide only for carding. _Here,i sell cvv,cc good live ...

Geschrieben von sellergood11 am 27.05.2026 22:07:04
Forum: Windows (Client/Server)
telegram:@king_dumps12 SELL CC CVV GOOD FRESH ALL COUNTRY

-------------------STUFF----------------- RDP : USA & WorldWide - Administrator - With AMS or TurboMailer ( port 25 opened ) . SMTP : IP or Domai ...

Geschrieben von sellergood11 am 27.05.2026 22:06:30
Forum: Hardware
@king_dumps12 Sell Cvv good fresh, Fullz info ssn dob + DL/ Dumps Pin, Cash App

-Hello all customers ! -I Seller best and alway sell CC fresh with hight balance -I have software do bug account bank and information western unio ...

Geschrieben von sellergood11 am 27.05.2026 22:04:54
Forum: BRAINSTORMING PHP/SQL/HTML/JS/CSS