One of the most important techniques in PHP is to intercept specified characters in a specified string. PHP can use the PHP pre-defined function substr () for string truncation. One of the most important techniques in PHP is to intercept specified
These four functions in PHP are often confusing, and here are some notes to take.
1, Strstr
strstr-displays the string that was found for the first time, to find, and subsequent strings. Case sensitive.
Code Listing:
[PHP]strstr function$email = '
In php, these four functions are often confusing. Take notes here.
1. strstr
Strstr-displays the string to be searched and the subsequent string found for the first time. Case sensitive.
Code List:
[Php]// Strstr Function$ Email = 'ruxing1715 @ sina.
Substr(PHP 4, PHP 5)
substr-returns a substring of a string
DescriptionString substr (string $string, int $start [, int $length])Returns a substring string string that is specified by the start and length arguments.
Parameters
String
The input
The younger brother not to tidy up the use of substr function, do a few examples to solve the confusion of the new, master please drift over.
Let's take a look at the syntax of the PHP substr function:
String substr (string string, int start, int
In almost all of the database tutorials there will be characters to intercept this function, all Datong small righteousness, let's take a look at the oralce in the data cutting function: The use of substr bar.
SUBSTR (' value to be cut ', cut from
Oracle substr function usage
Obtain the string substr (string, start_position, [length]) with the specified start position and length in the string.
Substr (string, truncation start position, truncation length) // return the truncated word;
When
This article mainly introduces the description and usage of substr () function parameters in php, analyzes the meaning of each parameter in substr () function in the form of an instance, and illustrates its usage, for more information about substr ()
This article mainly introduces the Slice, Substring, and Substr functions for intercepting strings in JavaScript. For more information, see in JavaScript, the method used to extract substrings is Slice, Substring, and Substr.
The Code is as
This article mainly introduces the substr () function parameter description and usage in PHP, analyzes the meaning of each parameter in the substr () function in the instance form, and illustrates its corresponding usage, and the friend who needs
PHP uses substr () to intercept strings. what should I do if Chinese characters are garbled ,. In PHP, how to use substr () to intercept strings with Chinese garbled characters? in PHP program development, string truncation operations, such as
Usage of InStr and SUBSTR in Oracle
Usage of instr in Oracle:
The format of the InStr method is
INSTR (The source string, the string to find, starting with the first few characters, to find the ordinal number of matches)
Returns the location found,
SUBSTR (' This was a test ', 6, 2) = ' is '
SUBSTR (' This was a test ', 6) = ' is a test '
substr (' techonthenet ', -3, 3) = ' Net '
substr (' Techonthenet ',-6, 3) = ' the '
substr (' ABCDE ', -6) = null
substr (' ABCDE ', -5) = ' ABCDE
This article describes the substr () function parameter description and usage in PHP. Share to everyone for your reference. Specifically as follows:
String substr (string $string, int $start [, int $length]), which can be used to find a matching
Grammar:
String substr (string $string, int $start [, int $length]), which can be used to find a matching string or character in a longer string, $string the string to be processed, $start the position to start the selection, $length is the length
An example of the character location (instr) retrieved by the oracle character truncation (substr) is as follows: substrinstr
I. Theory
Oracle truncation character (substr), search character location (instr) case when then else end statement use
Php tutorial substr () function parameter description and example tutorial/*String substr (string $ string, int $ start [, int $ length]), which can be used to search for matched strings or characters in a long string. $ String is the string to be
SUBSTR (), substring (), slice () methods are often used to intercept strings, and sometimes confusing usage, so summarized.
Reading Table of ContentsSlice ()substring ()substr ()• Summary
Slice ()
Definition: Accepts one or two arguments, and
Usage of instr in Oracle:The format of the InStr method isINSTR (The source string, the string to find, starting with the first few characters, to find the ordinal number of matches)Returns the location found, or 0 if it is not found.For example:
The use of Oracle's SUBSTR functionGets the string substr (string, start_position, [length]) of the specified starting position and length in the stringSuch as:SUBSTR (' This are a test ', 6, 2) would return ' is 'SUBSTR (' This are a test ', 6)
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.