There are many ways to convert strings into arrays in php. If there is regularity, we can directly use the explode () function to cut strings into arrays.
Definition and usage
The explode () function separates strings into arrays.
Syntax
Explode
Definition and usageThe explode () function separates strings into arrays.SyntaxExplode (separator, string, limit)ExampleIn this example, we split the string into an array: The code is as follows:Copy code $ Str = "Hello world. It's a beautiful
Analyze how the PHP function explode converts a string to an array. We are learning 1. the format of the PHP function explode is as follows: arrayexplode (stringseparator, stringstring, [intlimit]); 2. the separator in the parameter is the separator,
First, let's start. Write something simple.
Just started to learn PHP, when looking at PHP manual encountered a problem: in the function prototype with optional parameters, the optional parameters of the wording can not understand.
such as the
Analysis of explode function usage in php and phpexplode function usage. Php explode function usage analysis, phpexplode function usage this article examples analysis of php explode function usage. Share it with you for your reference. Details:
: This article mainly introduces the first blog post: Why is this option written in the PHP function prototype ?, If you are interested in the PHP Tutorial, refer. The first article is the beginning. Write something simple.
When I first started
Arabic numerals are converted into Chinese characters (big and lowercase)
Convert numbers into Chinese charactersWrite
Function number2Chinese ($ num, $ m = 1 ){
Switch ($ m ){
Case 0:
$ CNum = array (
Array ('0
First look at the definition of two methods:
Function prototype: Array split (String $pattern, string $string [, int $limit])
Function prototype: array explode (string $separator, string $string [, int $limit])
At first glance there is no
Explode
explode-using one string to split another stringArray explode (string $separator, string $string [, int $limit])
This function returns an array of strings, each of which is a substring of string, separated by the separator of the strings as
The php separator string is an array. Explodeexplode uses one string to split another string arrayexplode (string $ separator, string $ string [, int $ limit]). This function returns an array composed of strings, each explode
Explode-use one string
We are learningThe format of the 1.PHP function explode is as follows:
Array explode (string separator, string string,[int limit]);
2. The separator in the parameter is a delimiter, string is the character to be split, and limit is the maximum
First post: Optional parameters in PHP function prototypes Why do you write this? ,
First, let's start. Write something simple.
Just started to learn PHP, when looking at PHP manual encountered a problem: in the function prototype with optional
Article 1: Why do I write the optional parameters in the PHP function prototype ?,
The first article is the beginning. Write something simple.
When I first started learning PHP, I encountered a problem when I was reading PHP Manual: In the
To turn numbers into Chinese charactersWrote one of his own
function Number2chinese ($num, $m = 1) {
Switch ($m) {
Case 0:
$CNum = Array (
Array (' 0 ', ' one ', ' II ', ' three ', ' establishments ', ' Wu ', ' Lu ', '
This article describes the PHP common string output method. Share to everyone for reference, as follows: 1. echo Usage: Can be directly output with Echo or echo () output, no return value $string= " bold display text "; Echo $string;//echo "";//echo
This article describes common php string output methods. I would like to share with you the following details: 1. echo usage: can be output directly using echo (). No Return value $ string & amp; quot; & amp; lt; B & amp; gt; is returned; bold
Php string splitting function explode instance code. Arrayexplode (string $ separator, string $ string [, int $ limit]) This function has three parameters. The first parameter $ separator sets a delimiter (string ). The second parameter $ string
Differences between explode and split in php. First, let's take a look at the definition of the two methods: Function prototype: arraysplit (string $ pattern, string $ string [, int $ limit]) function prototype: arrayexplode (string $ separator,
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.