Coding php in Cutom Blocks

Hi,
I want to put a if/else statement in the custom block codes.
I tried

<?php
if()
{echo "";}
else
{echo "";}
?>

and smaller codes like

<?php
echo "";
?>

but doesn’t work;
I tried Smarty but that does not work neither.
Any idea about how I can check this condition in a Custom Block?

Best

Hmmm… I don’t think you can use PHP code there – if this would be safe…