You could use a switch
though with only the three options it doesn't save you any code:
switch(type){
case 'gallery':
$posticon = '<i class="fa fa-camera-retro"></i> ';
break;
case 'video':
$posticon = '<i class="fa fa-video-camera"></i> ';
break;
default:
$posticon = '';
break;
}