Connecting Tech Pros Worldwide Forums | Help | Site Map

variable of variable $$, ${ ...

cdt_sylvestre
Guest
 
Posts: n/a
#1: Jul 17 '05
hi,

i m trying to find how to access a variable of variable (which is an image)
i want to know the size of the picture
the name of the picture is photo1
next one is photo2, next one is photo3 ...


for ($i=1;$i<$MAX_PHOTOS;$i++)
{
$photo='photo'.$i;
$$photo_size; //don t work

}


thx




CountScubula
Guest
 
Posts: n/a
#2: Jul 17 '05

re: variable of variable $$, ${ ...


"cdt_sylvestre" <cdtEffacercAsly@relayeur.com> wrote in message
news:3ff934d6$0$17130$626a54ce@news.free.fr...[color=blue]
> hi,
>
> i m trying to find how to access a variable of variable (which is an[/color]
image)[color=blue]
> i want to know the size of the picture
> the name of the picture is photo1
> next one is photo2, next one is photo3 ...
>
>
> for ($i=1;$i<$MAX_PHOTOS;$i++)
> {
> $photo='photo'.$i;
> $$photo_size; //don t work
>
> }[/color]

I dont quite get where your comming from, I think a differnt language or oop
(short for oops)

a variable does not have properties, it is not an object as in VB, java, and
others...

try
$photo = "photo$i"; // just a little cleaner
$photo_size = filesize($photo); // if your wanting file size

--
Mike Bradley
http://www.gzentools.com -- free online php tools


Savut
Guest
 
Posts: n/a
#3: Jul 17 '05

re: variable of variable $$, ${ ...


Or getimagesize() if you need to know the width and height

Savut

"CountScubula" <me@scantek.hotmail.com> wrote in message news:UMaKb.6498$v97.1714@newssvr29.news.prodigy.co m...[color=blue]
> "cdt_sylvestre" <cdtEffacercAsly@relayeur.com> wrote in message
> news:3ff934d6$0$17130$626a54ce@news.free.fr...[color=green]
> > hi,
> >
> > i m trying to find how to access a variable of variable (which is an[/color]
> image)[color=green]
> > i want to know the size of the picture
> > the name of the picture is photo1
> > next one is photo2, next one is photo3 ...
> >
> >
> > for ($i=1;$i<$MAX_PHOTOS;$i++)
> > {
> > $photo='photo'.$i;
> > $$photo_size; //don t work
> >
> > }[/color]
>
> I dont quite get where your comming from, I think a differnt language or oop
> (short for oops)
>
> a variable does not have properties, it is not an object as in VB, java, and
> others...
>
> try
> $photo = "photo$i"; // just a little cleaner
> $photo_size = filesize($photo); // if your wanting file size
>
> --
> Mike Bradley
> http://www.gzentools.com -- free online php tools
>
>[/color]


Closed Thread