Variable variables and classes in PHP 3
| From: | Pablo Pasqualino | Date: | Thu, 23 Nov 2000 17:28:26 +0000 |
| Subject: | Variable variables and classes in PHP 3 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26846@lists.php.net to get a copy of this message | ||
Hi
I am having problems with the following code
$cantidad = 5;
for ($x = 1; $x <= $cantidad; $x++) {
$chica = 'img_i'.$x.'c';
$grande = 'img_i'.$x.'g';
$nombre_c = 'i'.$x.'c';
$nombre_g = 'i'.$x.'g';
$size_c = 'i'.$x.'c_size';
$size_g = 'i'.$x.'g_size';
$type_c = 'i'.$x.'c_type';
$type_g = 'i'.$x.'g_type';
$$chica = new Upload($$nombre_c,$$size_c,$$type_c);
$$grande = new Upload($$nombre_g,$$size_g,$$type_g);
if (($$chica->imagen) && (${$grande}->imagen) && (${$chica}->med(85,65)))
{
... some code ...
};
The error appears when I refer $$chica->imagen or similar
How can I do it in PHP 3?
I also tried writing ${$chica}->imagen but it doesnt work
It works fine in PHP 4, but in my web server I just can use PHP 3 :(
I hope someone can help
thanks!
Pablo Pasqualino
Mar del Plata, Argentina
http://www.marplatense.com