Reply to Re: [PHP] Re: php equivalent for cut

Your name:

Reply:


Posted by Philip Hallstrom on 09/07/05 01:14

> Am 2005-09-06 12:18:18, schrieb tg-php@gryffyndevelopment.com:
>
>> $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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация