Strtolower ($STR)
Strtoupper ($STR)
Uppercase and lowercase conversions
Strtotime (' 2018-1-1 0:0 ')
String Turn timestamp
Date (' y-m-d h:i:s ', Time ())
Formatting timestamps
MD5 ()
Encryption
Trim ()
Removes white space characters (in particular) on either side of the string.
Strip_tags ()
Filter (delete) HTML tags (specifically reserved)
Htmlspecialchars ()
Convert special characters (labels) to HTML entities (not labels)
Htmlspecialchars_decode
Restores
<?PHP//uppercase and lowercase conversions$str= ' WWW.BAIDU.COM ';Echo $str=Strtolower($str), ' ;Echo $str=Strtoupper($str), ' ;//String Turn timestampDate_default_timezone_set (' PRC ');//Set the default time zoneEcho $chuo=Strtotime(' 2018-1-1 0:0 '), ' ;//Formatting timestampsEcho Date(' Y-m-d h:i:s ',$chuo), ' ;Echo Date(' Y-m-d h:i:s ', Time()), ' ;//Thousands separator function$num= 123456789.125;Echo Number_format($num, 2), ' ;//EncryptEcho MD5(MD5(123456)), ' ;Echo SHA1(123456), ' ;//trim () removes white space characters on either side of the string. $test= ' Kyoto all ';Echo Trim($test), ' ;//remove the ' all ' character on the rightEcho RTrim($test, ' all '), ' ;//Filter HTML Tags$html= ' <b>;//<b> Label Selection retentionEcho $html,‘---‘,Strip_tags($html, ' <b> '), ' ;//convert special characters to HTML entities$htm= ' <b>;Echo $htm=Htmlspecialchars($htm), ' ;//now reverse the processEcho $htm= Htmlspecialchars_decode ($htm);?>
PHP 4 string Format function for string manipulation