Execute a string as if it were PHP code using the eval( ) function
$str = '$i = 1; print $i;'; eval($str);