Blogger Information
Blog 5
fans 0
comment 0
visits 3911
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
易混淆函数
君的博客
Original
737 people have browsed it

implode — 将一个一维数组的值转化为字符串 【

string implode    ( string $glue   , array $pieces   )

string implode    ( array $pieces   )

返回一个字符串,其内容为由 glue 分割开的数组的值。】

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);

echo $comma_separated; // lastname,email,phone

详情查看:  http://php.net/manual/zh/function.implode.php



explode — 使用一个字符串分割另一个字符串

【array explode    ( string $delimiter   , string $string   [, int $limit  ] )

此函数返回由字符串组成的数组,每个元素都是   string   的一个子串,它们被字符串   delimiter   作为边界点分割出来。】

// 示例 1
$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

详情查看: http://php.net/manual/zh/function.explode.php


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post