trying to use PHP extract() within a function

Posted by samuelf on Stack Overflow See other posts from Stack Overflow or by samuelf
Published on 2010-06-16T14:18:45Z Indexed on 2010/06/16 14:22 UTC
Read the original article Hit count: 132

Filed under:

Hi,

I have the two following files:

main.php

include("functions.php")  
__EXTRACT();  
echo $testvar;

functions.php

function __EXTRACT(){
extract($_POST, EXTR_SKIP);
}

However, having a form with a textbox called testvar I can't get the extract function to extract the data.. if I remove the function call and insert it the extract statement directly into main.php it works. The include is not a problem as other functions in it works. Any ideas?

Cheers

© Stack Overflow or respective owner

Related posts about php