i am trying to make $var1
to work on many different method
var1
is outcome of extract()
from an array that contains url parts
exp:
$url = 'localhost/site/className/edit/254/...';
$arr[var1] = 'edit';
$arr[var2] = '254';
$var1 = 'something';
class myClass{
function doSomething(){
echo $var1;
}
}
$obj = new myClass();
$obj->doSomething();
output:
Notice: Undefined variable: var1 in....
is there any way to fix it??