niche Posted May 29, 2009 Share Posted May 29, 2009 Please, I want this script:<?php$options = "";$thing = "Sports";$options.="<OPTION>".$thing. "</option>";echo $options;?>to echo: <OPTION>Sports</option>How do I escape the greater than / less than signs? I'm trying to build a drop down menu from a MYSQL table.Thanks Link to comment Share on other sites More sharing options...
Synook Posted May 29, 2009 Share Posted May 29, 2009 You encode them as entities, either manually or by using htmlspecialchars(). <?php$options = "";$thing = "Sports";$options.="<OPTION>".$thing. "</option>";echo htmlspecialchars($options);?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.