faqts : Computers : Programming : Languages : PHP : Installation and Setup : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

Why is fgets() always adding slashes to the string it returns?

Jun 28th, 1999 02:59
Nathan Wallace, Jim Winstead


For example, if fgets() sees this string in the socket:

    <a href="http//www.yahoo.com">Yahoo!</a>

it returns:

    <a href=\"http//www.yahoo.com\">Yahoo!</a>

You should check your value of magic_quotes_runtime.

From http://www.php.net/manual/configuration.php3

If magic_quotes_runtime is enabled, most functions that return data from
any sort of external source including databases and text files will have
quotes escaped with a backslash.