Hi. I need a function as shortcut of this code:
echo isset($var)?$var:'';
I tried this but I've got a notice:
function _($var=''){ return isset($var)?$var:''; }
Do you know a way to avoid notice ?
Bye.
function my_isset(&$var){ // pass variable by reference with "&" return isset($var)?$var:''; } echo my_isset(@$xyz); // use "@" to suppress notice if var is undefined
Good idea quick and quite dirty but it works 😉 Thanks a lot.