Php method of breaking characters into multiple strings, PHP character multiple strings
The example in this article describes how PHP breaks down characters into multiple substrings. Share to everyone for your reference. The implementation method is as follows:
The decomposition string is primarily implemented by the split () function, which is used to break a string into multiple substrings by a specified character and into the array separately. Its syntax is declared as follows:
Array Split (string pattern,string str[,int limit]);
The parameters are:
Pattern: Used to specify the symbol to be identified as a decomposition, note that the parameter is case sensitive.
STR: The string to be processed.
Limit: Returns the maximum value of the number of decomposed substrings, returned by default.
Examples are as follows:
Use the split () function to break down the string "2006-10-12 16:50:49" into a month-and-day time and minute substring, with the following program code:
Copy the Code code as follows: <?php
$date = "2006-10-12 16:50:49";
List ($year, $month, $day, $hour, $minute, $second) =split (' [-:] ', $date);
echo "Beijing time: {$year} year {$month} month {$day} day {$hour} {$minute} minutes {$second} seconds";
?>
The result of this example is: Beijing time: October 12, 2006 16:50 49 seconds
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/916062.html www.bkjia.com true http://www.bkjia.com/PHPjc/916062.html techarticle PHP breaks characters into multiple strings, PHP characters multiple Strings This example describes how PHP decomposes characters into multiple substrings. Share to everyone for your reference. Concrete implementation ...