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
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 :(
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.