String Reformatting Functions | |
---|---|
addcslashes() | |
string addcslashes(string $sOriginal, string $sEscapeList) | |
This function returns a string of the characters from $sOriginal with the characters of $sEscapeList with a backslash in front of them. | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
string $sEscapeList | This is a list of characters that will have slashes in front of them. |
addslashes() | |
string addslashes(string $sOriginal) | |
This function returns a string of the characters from $sOriginal with slashes before the characters that need to be escaped: ', ", \, and NULL. | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
convert_uudecode() | |
string convert_uudecode(string $sEncoded) | |
This function returns a string of characters that undo the encoding of convert_uuencode(). | |
Argument | Description |
string $sEncoded | This is the string that is to be unencoded. |
convert_uuencode() | |
string convert_uuencode(string $sOriginal) | |
This function returns a string of unix to unix encoded printable characters that represent the string $sOriginal, which may have unprintable characters. This encoding is used to protect against the fact that different systems may represent the unprintable character differently. This encoding can be unencoded with convert_uudecode(). | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
get_html_translation_table() | |
array get_html_translation_table(int $iTable = HTML_SPECIALCHARS, int $iFlags = ENT_COMPAT | ENT_HTML401, string $sEncoding = "UTF-8") | |
This function returns the table that is used by htmlspecialchars() or htmlentities() to translate strings. | |
Argument | Description |
int $iTable | This specifies the table that is to be used to translate characters: HTML_ENTITIES or HTML_SPECIALCHARS. |
int $iFlags | This set of flag bits specifies particular aspects of the translation table:
|
string $sEncoding | This specifies the encoding that is to be used:
|
html_entity_decode() | |
string html_entity_decode(string $sOriginal, int $iFlags = ENT_COMPAT | ENT_HTML401, string $sEncoding = "UTF-8") | |
This function returns the string $sOriginal with its HTML entities decoded according to the table that is used by htmlentities() to translate strings. This function is the opposite of htmlentities(). | |
Argument | Description |
string $sOriginal | This specifies the original string with the entities that are to be trnslated. |
int $iFlags | This set of flag bits is the same as those given by get_html_translation_table(). |
string $sEncoding | This encoding spcification is the same as the one given by get_html_translation_table(). |
htmlentities() | |
string htmlentities(string $sOriginal, int $iFlags = ENT_COMPAT | ENT_HTML401, string $sEncoding = ini_get("default_charset"), bool $bDoubleEncode = true) | |
This function returns the $sOriginal string with the special characters converted to HTML entites. If the input string is invalid for the specified encoding, an empty string is returned to indicate failure, unless ENT_IGNORE or ENT_SUBSTITUTE is specified. | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
int $iFlags | This set of flag bits is the same as those given by get_html_translation_table(). |
string $sEncoding | This encoding spcification is the same as the one given by get_html_translation_table(). |
bool $bDoubleEncode | This will not encode entities, if it is set to false. |
htmlspecialchars_decode() | |
string htmlspecialchars_decode(string $sOriginal, int $iFlags = ENT_COMPAT | ENT_HTML401) | |
This function returns the $sOriginal string with the HTML entites converted to the characters. This is the opposite of htmlspecialchars(). | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
int $iFlags | This set of flag bits is the same as those given by get_html_translation_table(). |
htmlspecialchars() | |
string htmlspecialchars(string $sOriginal, int $iFlags = ENT_COMPAT | ENT_HTML401, string $sEncoding = ini_get("default_charset"), bool $bDoubleEncode = true) | |
This function returns the $sOriginal string with the special characters converted to HTML entites. This function is similar to htmlentities(), excepthat it translates a slightly different set of characters. The specified translations are given by
|
|
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
int $iFlags | This set of flag bits is the same as those given by get_html_translation_table(). |
string $sEncoding | This encoding spcification is the same as the one given by get_html_translation_table(). |
bool $bDoubleEncode | This will not encode entities, if it is set to false. |
nl2br() | |
string nl2br(string $sOriginal, bool $bIsXhtml = true) | |
This function returns the $sOriginal string with html line breaks, either <br> or <br /> depending on the value of $bIsXhtml, before all endline characters: '\r', '\n', '\r\n' and '\n\r'. | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
bool $bIsXhtml | This determines whether the HTML (<br>) or XHTML (<br />) endlines will be inserted. |
quoted_printable_decode() | |
string quoted_printable_decode(string $sEncoded) | |
This function returns a string of characters that undo the encoding of quoted_printable_encode(). | |
Argument | Description |
string $sEncoded | This is the string that is to be decoded. |
quoted_printable_encode() | |
string quoted_printable_encode(string $sOriginal) | |
This function returns a string of quote-printable characters. | |
Argument | Description |
string $sOriginal | This is the string that is to be converted. |
quotemeta() | |
string quotemeta(string $sOriginal) | |
This function returns the $sOriginal string with a '\' before each of these characters: . \ + * ? [ ^ ] ( $ ). | |
Argument | Description |
string $sOriginal | This is a string that will be converted. |
strip_tags() | |
string strip_tags(string $sOriginal, string $sAllowedTags = "") | |
This function returns the $sOriginal string with the null bytes, HTML tags, and PHP tags removed from it. | |
Argument | Description |
string $sOriginal | This is a string that will be converted. |
string $sAllowedTags | This is a string is a set of tags that will not be stripped out. |
stripcslashes() | |
string strip_tags(string $sOriginal) | |
This function returns the $sOriginal string with backslashes removed from the special characters. It undoes addcslashes(). | |
Argument | Description |
string $sOriginal | This is a string that will be converted. |
stripslashes() | |
string strip_tags(string $sOriginal) | |
This function returns the $sOriginal string with backslashes removed from the special characters. It undoes addslashes(). | |
Argument | Description |
string $sOriginal | This is a string that will be converted. |
© 20072024 XoaX.net LLC. All rights reserved.