tags:

views:

34

answers:

2

If I am going to use the code:

extract(
  array(
    'key.name' => 'value',
    'somekey' => 'somevalue'
  )
)

Is there some way for me to retrieve the first value? E.g. ${'key.name'} or similar.

I know I can retrieve the second value with $somekey but I am curious if its possible with . in the name.

A: 

The answer is no. Give this post a read.

Babiker
+2  A: 

http://nl.php.net/manual/en/function.extract.php

Checks each key to see whether it has a valid variable name.

Nope, it won't extract 'key.name'. You can inspect the $GLOBALS array to see it isn't there.

Wrikken