If I have a function like this:
function convertArray($input)
{
}
How would I code it so it would produce results like the following?
$result = convertArray( array('a', 'b', 'c', 'd') );
// $result should be array( 'a' => array( 'b' => array( 'c' => array( 'd' => array() ) ) ) )
$result = convertArray( array('x', 'y', 'z') );
// $result should be array( 'x' => array( 'y' => array( 'z' => array() ) ) )
Is this possible?