papaface Posted May 17, 2010 Share Posted May 17, 2010 Hey, I am some text in a script that is converted as follows: function get_htmlspecialchars( $given, $quote_style = ENT_QUOTES, $double_quotes = false ) { if($double_quotes) return htmlspecialchars(htmlspecialchars( $given, $quote_style ) , $quote_style); else return htmlspecialchars( html_entity_decode( $given, $quote_style ), $quote_style ); } Example: get_htmlspecialchars($results['title'],ENT_QUOTES,true); How can I get it back to regular text instead of things like: ADELE 'Cold Shoulder' Lettering I can't for the life of me work out how to do it and its driving me insane lol Quote Link to comment Share on other sites More sharing options...
papaface Posted May 17, 2010 Author Share Posted May 17, 2010 Ok I worked out how to do it: htmlspecialchars_decode(htmlspecialchars_decode($conv_current['Title'], ENT_QUOTES ) , ENT_QUOTES); In the browser it now displays correctly as: ADELE 'Cold Shoulder' But in text boxes it displays as: <input type="hidden" id="conv_Title" value="ADELE 'Cold Shoulder'" /> Again Quote Link to comment Share on other sites More sharing options...
papaface Posted May 17, 2010 Author Share Posted May 17, 2010 html_entity_decode(htmlspecialchars_decode(htmlspecialchars_decode($conv_current['Title'], ENT_QUOTES ) , ENT_QUOTES),ENT_QUOTES) That did it. Quote Link to comment 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.