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
https://forums.phpfreaks.com/topic/141094-htmlentities-help/
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
https://forums.phpfreaks.com/topic/141094-htmlentities-help/#findComment-738539
Share on other sites

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.