This particular instance calls for arrays, like the others have said. However, for reference, you can do what you were trying to do like this:
${ 'radio_' . $ucount } = param( "radio_$ucount" );
${ "textarea$ucount" } = param( 'textarea' . $ucount );
Note that
- Variables won't be interpolated into a string that uses single-quotes.
print "something$ucount"; # prints 'something1'
print 'something$ucount'; # prints 'something$ucount'
- You can use the concatenation operator '.' (spot) to create single strings, which is often useful for clarity.
$x = "something$ucountElse";
# probably tries to interpolate a variable called
# $ucountElse, ambiguous
$x = "something" . $ucount . "Else"; # Unambiguous
- You can rewrite $name to ${'name'}, and you can interpolate this syntax too:
$x = "something${ucount}Else";