Split the string
//Use the explode function to split the string into an array
Copy the code The code is as follows:
$source = "hello1,hello2,hello3,hello4,hello5";//Separate strings by commas
$hello = explode(',',$source);
for($index=0;$index{
echo $hello[$index];echo "";
}
?>
//split function performs character splitting
// The separator can be a slash, dot, or horizontal line
Copy the code The code is as follows:
$date = "04/30/1973";
list($month, $day, $ year) = split ('[/.-]', $date);
echo "Month: $month; Day: $day; Year: $year
n";
?>
http://www.bkjia.com/PHPjc/730055.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/730055.htmlTechArticleSplit the string//Use the explode function to split the string into an array. Copy the code as follows: ?php $source = " hello1,hello2,hello3,hello4,hello5";//Separate strings by commas $hello = ex...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn