It parses input from a string according to a format
Example
<?php
$string = “first:php second:code”;
sscanf($string,”%s%s”,$first,$second);
echo $first.$second;
?>
Output
first:phpsecond:code
It parses input from a string according to a format
Example
<?php
$string = “first:php second:code”;
sscanf($string,”%s%s”,$first,$second);
echo $first.$second;
?>
Output
first:phpsecond:code
It returns a formatted string
Example
<?php
parse_str(“first=php&second=code”);
echo sprintf(“%s%s”,$first,$second);
?>
Output
phpcode
It calculates the soundex key of a string
Example
<?php echo soundex("phpcode"); ?>
Output
P123
It calculates the similarity between two strings
Example
<?php
echo similar_text(“phpcode”,”phpcodez”);
?>
Output
7
It calculates the SHA-1 hash of a file
Example
<?php
echo sha1(“phpcode”);
?>
Output
1786808aabe8b4f824ef2741a9e63bf8212e52d3
It calculates the SHA-1 hash of a file
Example
<?php
echo sha1_file(“test.txt”);
?>
Output
1786808aabe8b4f824ef2741a9e63bf8212e52d3
It sets locale information
Example
<?php
echo setlocale(LC_ALL,”En-Us”);
?>
It strips whitespace from the end of a string
Example
<?php
echo rtrim(“phpcode “);
?>
Output
phpcode
The quotemeta() function adds backslashes in front of some predefined characters in a string.
This function can be used to escape characters with special meanings, such as ( ), [ ], and * in SQL.
This function is binary-safe.
The predefined characters are:
Example
<?php echo quotemeta("php(code)'"); ?>
Output
php(code)’
It convert a 8 bit string to a quoted-printable string
Example
<?php
echo quoted_printable_encode(“php=0Acode”);
?>
Output
php=3D0Acode