From ef729dd9f622264593b1b9f6afef88d736aea660 Mon Sep 17 00:00:00 2001 From: Damien Seguy Date: Fri, 7 Feb 2003 05:07:51 +0000 Subject: [PATCH] upgrade example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@115029 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/array-splice.xml | 59 ++++++++++++++++++---- reference/array/functions/array-unique.xml | 23 ++++++--- 2 files changed, 63 insertions(+), 19 deletions(-) diff --git a/reference/array/functions/array-splice.xml b/reference/array/functions/array-splice.xml index 91a9b65870..2c21c0971b 100644 --- a/reference/array/functions/array-splice.xml +++ b/reference/array/functions/array-splice.xml @@ -1,5 +1,5 @@ - + @@ -61,16 +61,53 @@ The following equivalences hold: - - - + + <function>array_splice</function> equivalents + + + + + array_push($input, $x, $y) + + + array_splice($input, count($input), 0, array($x, $y)) + + + + + array_pop($input) + + + array_splice($input, -1) + + + + + array_shift($input) + + + array_splice($input, -1) + + + + + array_unshift($input, $x, $y) + + + array_splice($input, 0, 0, array($x, $y)) + + + + + $a[$x] = $y + + + array_splice($input, $x, 1, $y) + + + + +
Returns the array consisting of removed elements. diff --git a/reference/array/functions/array-unique.xml b/reference/array/functions/array-unique.xml index 0694afe398..b5c972f8b1 100644 --- a/reference/array/functions/array-unique.xml +++ b/reference/array/functions/array-unique.xml @@ -1,5 +1,5 @@ - + @@ -43,9 +43,13 @@ $input = array ("a" => "green", "red", "b" => "green", "blue", "red"); $result = array_unique ($input); print_r($result); - -/* Which outputs: - +?> +]]> + + + Cela va afficher : + + green @@ -67,14 +71,17 @@ Array $input = array (4,"4","3",4,3,"3"); $result = array_unique ($input); var_dump($result); - -/* Which outputs: - +?> +]]> + + + This script will output: + + int(4) [2] => string(1) "3" } -*/ ?> ]]>