Reply to Re: swaping numerical index for keys

Your name:

Reply:


Posted by "Matt Monaco" on 11/26/05 00:19

function addAssoc($ary_stat)
{
$ls_statfields = array(.....);

while ($assoc = each($ls_statfields)) {
$ary_stat[$assoc['key']] = $ary_stat[$assoc['value']];
}

return $ary_stat;
}

This should do what you want. I'm not sure if you want to remove the
numeric keys entirely, but after this function they still exist.


Matt



"Pooly" <pooly7@gmail.com> wrote in message
news:8db58d6b0511251326h4fc4ea3fg@mail.gmail.com...
Hi,

I've an array :
$ls_statfields=array(
"rfile" =>0,
"file" =>1,
"dev" =>2,
"ino" =>3,
"mode" =>4,
"nlink" =>5,
"uid" =>6,
"gid" =>7,
"rdev" =>8,
"size" =>9,
"atime" =>10,
"mtime" =>11,
"ctime" =>12,
"blksize" =>13,
"blocks" =>14
);

Which is the correspondance between the numerical and keys for stat
before PHP 4.0.6 :
http://uk.php.net/manual/en/function.stat.php

What would be the fastest solution to transform the result from stat
to the one with the keys (before 4.0.6 :-) ? (i.e. Exchanging
numerical indexing the for hash keys in the ls_statfields ?)

--
Pooly
Webzine Rock : http://www.w-fenec.org/

[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

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