Instance
Insert a newline character before the new line (\ n) in the string:
The browser output of the above code is as follows:
One line. Another line.
The HTML input for the above code is as follows (see source code):
One line.another
Instance
Convert hexadecimal values to ASCII characters:
The result of the above example output:
Hello world!
Definition and usage
The Hex2bin () function converts a string of hexadecimal values to ASCII characters.
Grammar
Hex2bin
Instance
Display the Hebrew characters backwards and convert the new line (\ n) to :
Definition and usage
The HEBREVC () function converts a right-to-left stream of Hebrew text to a left-to-right stream. At the same time, convert the new line (\ n)
Laravel's template engine uses the blade template engine, the following article mainly introduces the laravel in the blade templates engine related Materials, the text through the sample code introduced in very detailed, to everyone's study or work
Instance
Convert a string from one character set to another:
"; Echo convert_cyr_string ($str, ' w ', ' a '); >
Definition and usage
The convert_cyr_string () function converts a string from one Cyrillic character set to another.
The supported
PHP references (add & symbols before variables or functions, objects, etc.)
The reference in PHP means: Different names access the same variable content.
There is a difference between the pointers in the C language. The pointer inside the C
Instance
Return characters from different ASCII values:
"; Decimal Valueecho chr (052). ""; Octal Valueecho chr (0x52). ""; Hex value?>
Definition and usage
The CHR () function returns characters from the specified ASCII value.
The ASCII value can
Instance
Compares the key names and key values of two arrays (using a user-defined function to compare key names) and returns the intersection:
$b) 1:-1;} $a 1=array ("a" and "Red", "B" and "Green", "C" and "Blue"), $a 2=array ("D" and "Red", "b" =
definition: PHP retains all class methods starting with (two underscores) as a magic method. Therefore, in addition to the above magic method when defining a class method, it is not recommended to assume a prefix.
role : Using the Schema method
Instance
Break the string into arrays:
Definition and usage
The explode () function uses one string to split another string and returns an array of strings.
Note: the "separator" parameter cannot be an empty string.
Note: This function is binary
Definition and usage
The Echo () function outputs one or more strings.
Note: the Echo () function is not actually a function, so you do not have to use parentheses on it. However, if you want to pass more than one parameter to echo (), using
Instance
Reverses the key names in the array and the corresponding associated key values:
Definition and usage
The Array_flip () function is used to invert/swap the key names in the array and corresponding key values for the
Instance
Fills the array with the key value of the given key name:
Definition and usage
The Array_fill_keys () function fills an array with the key value given by the specified key name.
Grammar
Array_fill_keys (Keys,value);
Parameters
This article mainly introduces the PHP interface inheritance and interface multi-inheritance principle and implementation method, simply describes the interface inheritance and multi-interface inheritance concept, principle, and combined with the
PHP Rewrite Clinkpager instance of the paging device
1. Where are the custom pager classes placed?
There are two places to put,
The first kind is put in the protected/extensions, in the use is import come in, or in config file import come in;
The
Instance
Convert all characters to lowercase:
Definition and usage
The Strtolower () function converts a string to lowercase.
Note: This function is binary safe.
Related functions:
Strtoupper ()-Converts a string to uppercase
Lcfirst
Yii2 in use, when accessing the controller, if the name of the controller is the hump naming method, the URL of the visit should be changed to the form of horizontal lines. For example:
}//access to www.test.com/room-update such access
When you
test (); Require ("./ren.class.php"); Require_once ("./ren.class.php"); Require_once "./ren.class.php"; $f = new Ren (); $f->test ();
Automatically load class//1. All class filenames and class names should be consistent//2. All class files are
Instance
Find the first occurrence of "world" in "Hello world!" and return the remainder of the string:
Definition and usage
The STRCHR () function searches for the first occurrence of a string in another string.
The function is an alias of the
In our previous article we showed you what is a PHP probe, what PHP probe is doing, I believe you have a certain understanding of this is very familiar with, then today I use the PHP probe to detect the implementation of the Environment code share
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service