Re: Re: php equivalent for cut

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 2005-09-06 12:18:18, schrieb tg-php@xxxxxxxxxxxxxxxxxxxxxx:

$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 have a file as array with file() but
whats the best solution to put it into 3D style ?

I need only to extract the $USER, $GEKO and $HOMEDIR for
UID >= 1000.

Why not use posix_getpwuid()?

http://us2.php.net/manual/en/function.posix-getpwuid.php

-philip

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux