-3
I’m not able to understand how the scope of variables works in php, I try to use a variable, declared outside a function, inside this and it is null
$DSN = $dsn;
echo $DSN;
function insert_in_DB($query){
echo $DSN;
in case the echo above works, but the echo below does not
Justifying my downvote: https://ideone.com/7MGmEH
– bfavaretto