phpbar.de logo

Mailinglisten-Archive

[php] Split nur einmal splitten lassen

[php] Split nur einmal splitten lassen

Hartmut Holzgraefe hartmut_(at)_six.de
Tue, 06 Jun 2000 17:56:12 +0200


Markus Dobel wrote:
> Returns an array of strings, each of which is a substring of string
> formed by splitting it on boundaries formed by the regular expression
> pattern. If an error occurs, returns false.
> 
> To get the first five fields from a line from /etc/passwd:
>            ^^^^^^^^^^^^^^^^^
> Example 1. split() example
> 1
> 2 $passwd_list = split( ":", $passwd_line, 5 );
> 3
> 
> Die Implementierung der Funktion entspricht nicht der Beschreibung im
> Manual.

Mitlerweile steht da:

Returns an array of strings, each of which is a substring of string
formed 
by splitting it on boundaries formed by the regular expression pattern. 
If limit is set, the returned array will contaion a maximum of limit 
elements with the last element containing the whole rest of string. 
<-(!)
If an error occurs, split() returns false. 

Das ist allerdings mal wieder noch nicht überall angekommen ... :(

und das passwd-Beispiel ist tatsächlich etwas unglücklich

--
Hartmut Holzgraefe         hartmut_(at)_six.de           http://www.six.de


php::bar PHP Wiki   -   Listenarchive