I am a novice coder and I have a php variable that I need to put a php snippet inside, but I always get a syntax error.
The code goes something like this:
$f_data= '
Invoice By : '.$user.'
Status : '.$Status.'
Customer Name : '.$cname.'
Company : '.$company.'
PoS : '.$pos.'
';
And I am trying to put another php snippet inside the above variable which hides a particulare line if a variable is empty like this:
$f_data= '
'<?php if (isset($user) && !empty($user)) { ?>' Invoice By : '.$user.' '<?php } ?>'
Status : '.$Status.'
Customer Name : '.$cname.'
Company : '.$company.'
PoS : '.$pos.'
';
I always get the error "Parse error: syntax error, unexpected '?'" with this line.
Please help me find what 'm doing wrong here.
Thanks for your help.