Undefined variables or indexes of arrays can be a real pain if you have a strong error level setup.
isset($var)?$var:'';
can be very tedious if you have a long script.
So, here's my thought--
Simple, though seems to be convenient.PHP Code:function valueof($var) {
return isset($var)?$var:'';
}
Much faster than the other options.
That should be included in PHP by default, I think.



Reply With Quote

Bookmarks