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 Link to comment https://forums.phpfreaks.com/topic/202081-convert-string-to-regular-text-issue/ 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 Link to comment https://forums.phpfreaks.com/topic/202081-convert-string-to-regular-text-issue/#findComment-1059693 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. Link to comment https://forums.phpfreaks.com/topic/202081-convert-string-to-regular-text-issue/#findComment-1059699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.