Hello all,
I have a string of text with an if statement in it. But I get a parse error stating there is an unexpected if statement. Can anyone help?
$var .= '
<a href="http://www.theurl.com" '.if($new !='') { echo 'target=\\"_blank\\"'; }.'>Click Here</a>';
}
Thanks
frank1
2
easier to read
<?php
$target=‘’;
if ($new!=‘’)
{
$target='‘target=\“_blank\”’;
}
$var=“<a href=\“http://www.theurl.com\” $target>Click Here</a>”;
?>
how is that
I’ll chime in. 
printf(
'<a href="http://www.example.com/" %s>example.com</a>',
('' === $new) ? 'target="_blank"' ; ''
);