<?php
/**
* Created by Guopeng.
* User:msi
* DATE:2017/9/27
* Time:14:17
*/
Random number generator
EchoRAND ();
Echo"<br>";
Generate a range of random numbers
EchoRand0,10);
Echo"<br>";
Gets the current time stamp
EchoTime ();
Echo"<br>";
Format the display of time
Echo"<br>";
EchoDate"Y-m-d h:i:s",Time ());
Echo"<br>";
EchoDate"Y-m-d h:i:s","1506494976");
String converted to Timestamp
Echo"<br>";
EchoStrtotime ("2017-09-27 14:37:39");
Echo"<br>";
Take the length of the string
$str 1="ABCDEFG";
$str 2="ABC";
Echo strlen ();
Echo"<br>";
Compare two strings, US standard code for information interchange;
Var_dump (strcmp ($str 1,$str 2));
Turn lowercase
Echo"<br>";
Strtolower ($str 2);
Turn capital
Strtoupper ();
Splitting a string
Echo"<br>";
Var_dump (Explode ("B",$str 2));
Stitching array elements into a single string
Echo"<br>";
EchoImplode ("|",[A,"B",C]);
Replace replace
Echo"<br>";
Here is the return value, so use the echo output;
EchoStr_replace ("CD","CD",$str 1);
Echo"<br>";
Echo$str 1;
Replaces a string at the specified position
Echo"<br>";
EchoSubstr_replace ($str 1,"XXX",0,3);
Intercept string
Echo"<br>";
EchoSubstr$str 1,1,3 ) ;
//Regular expression
$str =<<<a
456abcdefghijklmn123
A ;
echo "<br>" ;
//the number of all characters above is replaced with #
echo Preg_replace ( "/\d/" , "#" , $str ) ;
/span>
Substitution of PHP characters, intercepting, specifying find