I want to generate a class instance for each post value.
Something like this
$i=0;
foreach ($_POST['URL'] as $url) {
$classInstance.$i = new className();
$i++;
}
Each with a different name.
I read about variable variable names like:
${"classInstance" . $i} = new className();
But it's been previously discouraged in other questions (PHP Variables - Concatenate variable name)
Is there any other way to achieve the same without using variable variable names?