Re: Is fgetss() useless?
| From: | Maciej Sobaczewski | Date: | Tue, 29 Jul 2014 07:10:38 +0000 |
| Subject: | Re: Is fgetss() useless? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76248@lists.php.net to get a copy of this message | ||
Hello Tjerk,
thanks for the explanation. This is close to what I thought. So, if there is a difference, I see no point in proposing to remove it. You can consider this thread as closed ;)
Have a nice day,
Maciej.
Hi Maciej, On Mon, Jul 28, 2014 at 7:21 PM, Maciej Sobaczewski <msobaczewski@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)).Thefgetss()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 applystrip_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