jason360 Posted March 28, 2014 Share Posted March 28, 2014 Hey guys, Not sure how to concatenate this php string properly. This is what I have now and I don't think it is correct: <?php if(loggedin()){echo '<div class="like-btn <?php if($like_count == 1){ echo "like-h";} ?>"><!-- Like --></div>';} ?> Any help would be appreciated. Thanks JK Link to comment https://forums.phpfreaks.com/topic/287376-concatenate-php/ Share on other sites More sharing options...
boompa Posted March 28, 2014 Share Posted March 28, 2014 Much easier to do this: <?php if(loggedin()){ ?> <div class="like-btn <?php if($like_count == 1){ echo "like-h";} ?>"><!-- Like --></div> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/287376-concatenate-php/#findComment-1474363 Share on other sites More sharing options...
jason360 Posted March 28, 2014 Author Share Posted March 28, 2014 Awesome thanks Boompa! It sure didn't seem right what I had. Link to comment https://forums.phpfreaks.com/topic/287376-concatenate-php/#findComment-1474366 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.