Jump to content

htmlentities help


phpretard

Recommended Posts

I am trying to include a page based on a session value:

 

[client] => Anthony&#039;s << SESSION VALUE

include ("clients/".$_SESSION['client']."/index.php");  << CODE

include ("clients/Anthony&#039;s/index.php"); << DOES NOT EXIST

include ("clients/Anthony's/index.php"); << DOES EXIST

 

How can I translate &#039; to  ' based on the code above.

 

Any Help Today?

 

 

 

 

 

 

 

Link to comment
Share on other sites

As kenrbnsn included in his code, but did not state, the second, optional, parameter for htmlspecialchars_decode is for "quote style":

 

From the manual:

quote_style constants

Constant Name Description

ENT_COMPAT Will convert double-quotes and leave single-quotes alone (default)

ENT_QUOTES Will convert both double and single quotes

ENT_NOQUOTES Will leave both double and single quotes unconverted

 

 

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.