Use of an array element

From: Date: Tue, 14 May 2002 17:02:45 +0000
Subject: Use of an array element
Groups: php.general 
Request: Send a blank email to php-general+get-97607@lists.php.net to get a copy of this message
Is there any way of using an array element in the same line as it is filled? For instance, here's what I have: Say I want the image width of a pic, I have to: $f = getimagesize("certainpic.jpg"); print("$f[0]"); After this, I never use $f anymore. There's no reason to have it hanging around. Is there any way I can simply just getimagesize() and print the width at the same time, like say: print(getimagesize("certainpic.jpg")[0]); This is only an example. I'm sure there may be a function that will return an image width and be able to print it instantly, and yes I can whip one up, but the point is to be able to use an array element at the same time that the array is filled. __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com

« previous php.general (#97607) next »