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 Hallstrom:/local/home/philip:/bin/tcsh

$fields is going to look like this:

0 = philip
1 = *
2 = 1000
3 = 1000
4 = Philip Hallstrom:/local/home/philip:/bin/tcsh

I think what he really wants is:

$fields = explode(':', $string);
$fullname = $fields[4]; // Philip Hallstrom


-philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to