ben03 Posted May 14, 2013 Share Posted May 14, 2013 Hi all, New to php. have a question but didn't know how to write in in google to get answer so hopefully someone can make sense of it here! This is the code blow. The title is being bought in but basically want a line of text to be bought in if the entry is blank. Getting an error with the following: <p class="feed-title"><?php echo $item['TITLE']; ?></p> <?php if ($item['TITLE']; = "") { echo "More great offers and topics can be found on our Facebook page. Click below for more"; } ?> Hopefully someone can make sense of this. I am currently fumbling. Thanks Link to comment Share on other sites More sharing options...
jeffman Posted May 14, 2013 Share Posted May 14, 2013 Yours: if ($item['TITLE']; = "") Corrected: if ($item['TITLE'] == "") Note that this still might throw a warning (not an error) if $item['TITLE'] has never been set in the first place. If that's possible, this would work: if (empty($item['TITLE']) ) Link to comment Share on other sites More sharing options...
ben03 Posted May 14, 2013 Author Share Posted May 14, 2013 That worked perfectly. Thanks for your help there! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now