# file()+strip_tags() Vs. fgetss(). huge diffrence normal?

- Thread: https://externals.io/message/12179
- Original archive: https://news-web.php.net/php.internals/12179
- Started by Hannes Magnusson on 2004-08-16T03:35:46+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12179 — Hannes Magnusson — 2004-08-16T03:35:46+00:00

URL: https://externals.io/message/12179#12179

Hibb.

Is there suppost to be such a huge diffrence between these two methods?
Would have thougt combination of `file()` & `strip_tags()` would result in same results as fgetss()
<?php
    $file = file ( "http://no2.php.net/" );
    $fp = fopen ( "http://no.php.net/", "r" );
    $i = 0;
    
    while ( !feof ( $fp ) ) {
        echo "fgetss:     "; var_dump ( trim ( fgetss ( $fp, 3072 ) ) );
        echo "strip_tags: "; var_dump ( trim ( strip_tags ( $file[ $i++ ] ) ) ) ;
    }
?>
See live example: http://62.249.185.14/examples/fgetss.php

- Hannes

---

## #12180 — Sara Golemon — 2004-08-16T03:56:42+00:00

URL: https://externals.io/message/12179#12180 · In reply to: #12179

Look at the lines that differ.  `strip_tags()` doesn't know anything about
tags that started on previous lines.


"Hannes Magnusson" <bjori@jeshus.com> wrote in message
news:20040816053546.62ac4a35.bjori@jeshus.com...
> Hibb.
>
> Is there suppost to be such a huge diffrence between these two methods?
> Would have thougt combination of `file()` & `strip_tags()` would result in
same results as fgetss()
> <?php
>     $file = file ( "http://no2.php.net/" );
>     $fp = fopen ( "http://no.php.net/", "r" );
>     $i = 0;
>
>     while ( !feof ( $fp ) ) {
>         echo "fgetss:     "; var_dump ( trim ( fgetss ( $fp, 3072 ) ) );
>         echo "strip_tags: "; var_dump ( trim ( strip_tags ( $file[
$i++ ] ) ) ) ;
>     }
> ?>
> See live example: http://62.249.185.14/examples/fgetss.php
>
> - Hannes

---

## #12181 — Hannes Magnusson — 2004-08-16T04:20:40+00:00

URL: https://externals.io/message/12179#12181 · In reply to: #12180

On Sun, 15 Aug 2004 20:56:42 -0700
pollita@php.net (Sara Golemon) wrote:

> Look at the lines that differ.  `strip_tags()` doesn't know anything about
> tags that started on previous lines.
Ahhh! noticed now. Thx. :)
> 
> 
> "Hannes Magnusson" <bjori@jeshus.com> wrote in message
> news:20040816053546.62ac4a35.bjori@jeshus.com...
> > […]
> same results as fgetss()
> > […]
> $i++ ] ) ) ) ;
> > […]
