Hi Maciej,

On Mon, Jul 28, 2014 at 7:21 PM, Maciej Sobaczewski <msobaczew...@gmail.com>
wrote:

> Hello guys,
>
> so... fgetss(). We have such a beautiful function in PHP. As it's
> described in the manual: "Get line from file pointer and strip HTML tags".
> I'm wondering if it has any differences/advantages over using just
> strip_tags(fgets($stream)).
>

The `fgetss()` function keeps the strip_tags state between reads to provide
consistent results; observe the following example:

hello <html>
<?php
echo "we don't want this;"
?>
</html> world

This should rightfully output only "hello world" (and some newlines); if
you would apply `strip_tags()` on each individually read line, you would
also get stuff you don't want.



> I'm going to write an RFC proposing deprecation and then removal of it,
> but first I want to ensure that this function is as useless (IMHO) as I
> think.
>
> Best regards,
> Maciej.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
--
Tjerk

Reply via email to