ontheplains Posted May 7, 2007 Share Posted May 7, 2007 hey guys, so here is what i'm trying to do. i have 4 fields (noun1, noun2, noun3, verb1) for a person to fill out and what they put into these fields will be printed out at certain points throughout a quotation (basically, it's a madlib with quotes from the simpsons and futurama). after the four fields, i allow them to select from a drop-down select menu with the options of bold, underlined, italics. what i need done is that IF they select any of those, i need what is printed out from the fields to be printed out with HTML tag formats (<b><u><i>). if you need more info, just let me know. any help would be very appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/50412-function-to-add-html-tags-to-text/ Share on other sites More sharing options...
per1os Posted May 7, 2007 Share Posted May 7, 2007 <?php if (isset($_POST['italics'])) $output = "<i>" . $output . "</i>"; if (isset($_POST['bold'])) $output = "<b>" . $output . "</b>"; if (isset($_POST['underline'])) $output = "<u>" . $output . "</u>"; ?> One way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/50412-function-to-add-html-tags-to-text/#findComment-247639 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.