Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 133

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>array_shift</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Array - funcþii"
HREF="ref.array.html"><LINK
REL="PREVIOUS"
TITLE="array_search"
HREF="function.array-search.html"><LINK
REL="NEXT"
TITLE="array_slice"
HREF="function.array-slice.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.array-search.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.array-slice.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.array-shift"
></A
>array_shift</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN6547"
></A
><P
>    (PHP 4 , PHP 5)</P
>array_shift&nbsp;--&nbsp;
     Shift an element off the beginning of array
    </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN6550"
></A
><H2
>Description</H2
>mixed <B
CLASS="methodname"
>array_shift</B
> ( array array)<BR
></BR
><P
>&#13;     <B
CLASS="function"
>array_shift()</B
> shifts the first value of the
     <VAR
CLASS="parameter"
>array</VAR
> off and returns it, shortening the
     <VAR
CLASS="parameter"
>array</VAR
> by one element and moving everything
     down.  If <VAR
CLASS="parameter"
>array</VAR
> is empty (or is not an
     array), <TT
CLASS="constant"
><B
>NULL</B
></TT
> will be returned.
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN6565"
></A
><P
><B
>Exemplu 1. <B
CLASS="function"
>array_shift()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
$stack = array ("orange", "banana", "apple", "raspberry");<br />$fruit = array_shift ($stack);</font>
</code></TD
></TR
></TABLE
><P
>&#13;       This would result in <VAR
CLASS="varname"
>$stack</VAR
> having 3 elements left:
       <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
Array<br />(<br />&nbsp;&nbsp;&nbsp;&nbsp;[0] =&gt; banana<br />&nbsp;&nbsp;&nbsp;&nbsp;[1] =&gt; apple<br />&nbsp;&nbsp;&nbsp;&nbsp;[2] =&gt; raspberry<br />)</font>
</code></TD
></TR
></TABLE
>
       and <VAR
CLASS="literal"
>orange</VAR
> will be assigned to
       <VAR
CLASS="varname"
>$fruit</VAR
>.
      </P
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     See also <A
HREF="function.array-unshift.html"
><B
CLASS="function"
>array_unshift()</B
></A
>,
     <A
HREF="function.array-push.html"
><B
CLASS="function"
>array_push()</B
></A
>, and
     <A
HREF="function.array-pop.html"
><B
CLASS="function"
>array_pop()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.array-search.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.array-slice.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>array_search</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.array.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>array_slice</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>