Sting from variable in If statement - help
here is the process to make the parameters for the if and they are finally put into $statement
$exclude = array(1=>'preg_match("/^mailto:/", $href)',
2=>'preg_match("/javascript:/", $href)',
'(preg_match("/^http:\/\/|https:\/\//", $href) && !preg_match("/".$domain."/", $href))',
'preg_match("/(\/{2,})$/", $href)',
'preg_match("/\?/", $href)',
'preg_match("/\#/", $href)',
'preg_match("/^https:\/\//", $href)');
//print_r($exclude);
foreach($exclude as $key =>$value){
if($key == count($exclude)){
$statement .= $value;
} else{
$statement .= $value.' || ';
}
}
echo $statement;
when i do this:
if($statement){
it won't work
here is the output i see from statement
preg_match("/^mailto:/", $href) || preg_match("/javascript:/", $href) || (preg_match("/^http:\/\/|https:\/\//", $href) && !preg_match("/".$domain."/", $href)) || preg_match("/(\/{2,})$/", $href) || preg_match("/\?/", $href) || preg_match("/\#/", $href) || preg_match("/^https:\/\//", $href)
Why can't this work or can it and i am missing something??

