Expanded the example to print some of the returned values.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@126565 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-05-11 17:55:50 +00:00
parent 5504581782
commit 1687911519

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.explode">
<refnamediv>
@ -41,11 +41,20 @@
<title><function>explode</function> examples</title>
<programlisting role="php">
<![CDATA[
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
<?php
// Example 1
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
print $pieces[0]; // piece1
print $pieces[1]; // piece2
// Example 2
$data = "foo:*:1023:1000::/home/foo:/bin/sh";
list($user,$pass,$uid,$gid,$gecos,$home,$shell) = explode(":",$data);
print $user; // foo
print $pass; // *
?>
]]>
</programlisting>
</example>