Is it possible to use the value of a variable as the first parameter
to a list() command?
I'm trying the following with no success - I did have the variables
hardcoded in the list command - but I'd like to be able to make this
variable too if possible - can it be done simply? The only way I can
think of is creating the php script on the fly and running that, which
I'd rather not do?
<?php
// explode string into a structured record
$temp = '$title,
$first_name,
$surname,
$address_line1,
$address_line2,
$address_line3,
$address_line4,
$address_line5,
$postcode';
echo $temp;
list(
//define record structure
${$temp}
) = explode($file_delimiter,$buffer);
echo $title;
?> |