using function()[subscript] directly

From: Date: Sun, 23 Feb 2003 10:32:33 +0000
Subject: using function()[subscript] directly
Groups: php.general 
Request: Send a blank email to php-general+get-136714@lists.php.net to get a copy of this message
Hi! I started out with $stat = stat("$gallery_dir/$pix_base") ; $mode = decoct($stat[mode]) ; print "mode = '$mode'<br>\n" ; and moved to $stat = stat("$gallery_dir/$pix_base") ; print "decoct(stat[mode]) is '" . decoct($stat[mode]) . "'<br>\n"; ### but I would like to get rid of $stat as well. How can I feed the proper subscript output of the stat call to decoct? I've found that print "decoct(stat(file)[mode] is '" . decoct($stat("$gallery_dir/$pix_base")[mode]) . "'<br>\n" ; ### gives me a parse error, while print "decoct(stat(file)[mode] is '" . decoct(${stat("$gallery_dir/$pix_base")}[mode]) . "'<br>\n" ; ### just returns 0. Do I *have* to use a temp array here? TIA & HAND :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#136714) next »