网络创造未来!

胡侃在donews,技术在CSDN。 :-D

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  212篇文章 :: 75篇收藏:: 211篇评论:: 8个Trackbacks

公告

我的卡通头像

关注技术:

cms
中文分词

关注领域:

教育信息化

留言板留言板


CSDN我的BLOG(点击进入)

E-mail:

QQ:
6979184

MSN:
shimchatmn at msn dot com

    从一众好友那里,我学会了以不带仇恨的心去爱人和热爱生活。

Creative Commons License
本作品采用署名-非商业性使用 2.5 中国大陆授权.

    本站部分内容来源于互联网,如果侵犯了你的权利,请email告知,我将及时撤除。

下载Frefox浏览器

文章

收藏

相册

^_^我的博友(del.icio.us)

CSDN邻居

donews邻居

donews邻居2

程序人生

高人

教育类

论坛和好版

朋友

网络服务

网络与数据库

存档


正在读取评论……



explode

(PHP 3, PHP 4 , PHP 5)

explode -- Split a string by string

Description

array explode ( string separator, string string [, int limit])

Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string separator. If limit is set, the returned array will contain a maximum of limit elements with the last element containing the rest of string.

If separator is an empty string (""), explode() will return FALSE. If separator contains a value that is not contained in string, then explode() will return an array containing string.

Although implode() can, for historical reasons, accept its parameters in either order, explode() cannot. You must ensure that the separator argument comes before the string argument.

注: The limit parameter was added in PHP 4.0.1

例子 1. explode() examples

<?php
// Example 1
$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo
$pieces[0]; // piece1
echo $pieces[1]; // piece2

// Example 2
$data = "foo:*:1023:1000::/home/foo:/bin/sh";
list(
$user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
echo
$user; // foo
echo $pass; // *

?>

See also preg_split(), spliti(), split(), and implode().



Trackback: http://tb.donews.net/TrackBack.aspx?PostId=403746


[点击此处收藏本文]  发表于2005年05月29日 2:44 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论