Q: eval()'d code on line xx i have this code , i want to convert the get(title) to variable , its correctly working , for example i have variable 'news , sport, program ' , my problem is that when someone is changing the title="news" to title=new , and i dont have the new variable how i can control it when the user change the title ;
this will appear an error that the variable undefined and eval()'d code on line xx error
if(isset($_GET['title']))
    $title=stripslashes($_GET['title']);
else
   $title="news";

$trimed=trim(strtolower($title));
$variable="$".str_replace(" ","_",$trimed);
$title=eval('return '.$variable.';');  

if(!isset($title))
    $title=$$title;

thank you for help 

A: You can use ${} syntax and replace:
$title = eval('return '. $variable.';');  

With:
$title = ${'return '. $variable};  


A: Just do like this:
$nameOfVar = 'return' . $variable;
$title = $nameOfVar;

