View Single Post

  #5 (permalink)  
Old 05-08-2008
Piotr
 
Posts: n/a
Default Re: Question about 'sizeof'

>> $thumb = 1;
>> $item = '$thumbs_cat_' . $thumb; //this outputs a string:
>> $thumbs_cat_1
>>
>> $item_total = sizeof($item);
>> output: Nothing!
>>
>> How do i pass a variable to the 'sizeof' function?

>
> You should use variable variable:
> $item_total = sizeof($$item);
>
> Mark double $$
> This is true in any situation, not only with sizeof


Forgot about one small detail:
$item = 'thumbs_cat_' . $thumb; //this outputs a string:
---------^ loose the '$';

best regards
Piotr N
Reply With Quote