Jump to content

Convert string to regular text issue!


papaface

Recommended Posts

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

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 &#039;Cold Shoulder&#039;" />

Again :(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.