Use PHP to share user-defined functions hidden by asterisks (*) in the middle of a mobile phone number.The Code is as follows:
Method 1:
Function hidtel ($ phone ){
$ IsWhat = preg_match ('/(0 [0-9] {2, 3} [\-]? [2-9] [0-9] {6, 7} [\-]? [0-9]?)
There are always some complex logic that we need to use more than once, and it shows the importance of the function at this point.Features of the MySQL function
Name of function
Parameter list
function body
return value
A user-defined function is a block of code stored in a database that can return a value to the calling program. There are 3 types of arguments for a function:
(1) in Parameter type: Represents an argument entered into a function that can only be
Let's start with someone else's example:The Call_user_func function is similar to a particular method of calling a function, using the following method:
Copy Code code as follows:
function A ($b, $c)
{
Echo $b;
Echo $c;
}
A user-defined function cannot be used to perform a series of operations that alter the state of a database, but it can be like a system letterUsed in a program segment, such as a query or stored procedure, or as a stored procedure.Execute command.
This article mainly introduces PHP generation of proportional thumbnails class and user-defined function sharing, respectively encapsulated into a class and user-defined function, for more information, see the following two proportional thumbnails.
1
You can use the call_user_func function to call a user-defined function by passing in the string function, and reference is supported. This function allows users to call directly written functions and input certain parameters. The following
Analyze the calluserfunc () function in PHP and how to use calluserfunc to call the custom function callfunc. Analysis on the calluserfunc () function in PHP and how to use calluserfunc to call a user-defined function. in the callfuncUCenter source
Because of work requirements, you need to write a mysql custom number of rows, as shown below: DELIMITER $ DROPFUNCTIONIFEXISTS 'onlinefunction '$ CREATEFUNCTION 'onlinefunction' (rrrrVARCHAR (50) RETURNSVARCHAR (255) BEGINIF (rrrronline) THENRETURN
There are two proportional thumbnails for reference.1. It is a class file and can be used after being instantiated.2. It is lightweight for custom methods
Class FileCopy codeThe Code is as follows: $ resizeimage = new resizeimage ("./shawn.jpg", "200
Common functions of encoding, such as getting an IP address, sending an email, curl encapsulation, encryption, decryption, String object, and conversion to an array, will be followed by a supplement without obtaining ipfunded IP () {if (getenv
FristPinyin: This function is used to convert the first Chinese character of a Chinese string into a pinyin letter (for example, "Chinese"-> Z)Copy codeThe Code is as follows:Create function 'fristpinin' (P_NAME VARCHAR (255) RETURNS varchar (255)
Php random password generation code. use the php custom function to generate a random password of the specified length. the password is a random string of lowercase letters and numbers. The length can be customized. A random password function is
The createorreplacefunctionsf_Split_String (sourceStringvarchar2, -- string to be split. The format is as follows:
The create or replace function sf_Split_String (sourceString varchar2, -- string to be split, as shown in
String splitting
1. truncation of the Title Function TLen ThenCutTitle = Left (Title, TLen )&".. "ElseCutTitle = TitleEnd IfEnd Function %> usage 2. add, modify, and delete functions return "response. endend ifConn.exe cute ("insert into AD_Click (AD_Name,
The Directory user-defined function PHP does not provide functions for querying the directory size, copying directories, and deleting directories with files. you only need to write this function by passing a url, you can recursively query the file
When a user-defined function is called multiple times on the same page and the same value is obtained, a user-defined function pici () is used to obtain the value of the pi field under a sequential number, then + 1 (when there is no record for this
A user-defined function is a code block stored in a database. It can return the value to the calling program. The call is like a system function, such as a max (value) function. value is called a parameter. There are three types of function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.