jason360 Posted March 28, 2014 Share Posted March 28, 2014 (edited) 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 Edited March 28, 2014 by jason360 Quote Link to comment https://forums.phpfreaks.com/topic/287376-concatenate-php/ Share on other sites More sharing options...
Solution boompa Posted March 28, 2014 Solution 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 } ?> Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/287376-concatenate-php/#findComment-1474366 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.