I want hide my one button and so I am looking for add style = "display:none;" in it but since I am already using PHP code for echo that button, I am confused how I can use it. I am trying to do it like below
<?php
$style = "";
if($this->session->userdata('user_id') == $member['user_id']) {
$style = "style='display:none;'";
}
if ($member2 == 0){
echo '<a href="'.site_url('members/addfriend/'.$member['user_id']).'" class="btn btn-primary">Add As Friend <?php echo $style;?> </a>';
} else {
echo '<a href="'.site_url('members/removefriend/'.$member['user_id']).'" class="btn btn-primary">Remove Friend </a>';
}
?>
I am looking for apply above style code in my Add Friend button but I am not getting idea how I can use $style variable in my below line code
echo '<a href="'.site_url('members/addfriend/'.$member['user_id']).'" class="btn btn-primary">Add As Friend <?php echo $style;?> </a>';
Let me know if someone can help me for do it. Thanks!