[PHP] Re: php equivalent for cut

2005-09-06 Thread Matthew Weier O'Phinney
* Michelle Konzack [EMAIL PROTECTED]: I am searching for the right equivalent for cut -d : -f5 but it must work with php4. $fields = explode(':', $string, 5); Since the website http://www.php.net/manual/de/ has no seperated manuals for php4 and php5, it is not easy to find the right stuff.

Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom
I am searching for the right equivalent for cut -d : -f5 but it must work with php4. $fields = explode(':', $string, 5); Hmmm.. that's going to create a 5 element array assigned to $fields. So, using /etc/passwd as an example... philip:*:1000:1000:Philip

[PHP] Re: php equivalent for cut

2005-09-06 Thread Michelle Konzack
Hi, Am 2005-09-06 12:18:18, schrieb [EMAIL PROTECTED]: $etcpasswd = username:passwd:123:345::/home/username:/bin/sh; $pwdarr = explode(:, $etcpasswd); echo $pwdarr[4]; OK, this works now. But can I read a whome /etc/passwd into an 3d array ? This would avoid multiple reads... I know, that

Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom
Am 2005-09-06 12:18:18, schrieb [EMAIL PROTECTED]: $etcpasswd = username:passwd:123:345::/home/username:/bin/sh; $pwdarr = explode(:, $etcpasswd); echo $pwdarr[4]; OK, this works now. But can I read a whome /etc/passwd into an 3d array ? This would avoid multiple reads... I know, that I can