Hi, I am using a $get function to get a variable from the URL as my page subtitle. It works fine except if the variable has an apostrophe in it. Then the title has a backslash in front of the apostrophe (probably to escape that apostrophe). Not sure how to remove that back slash only in the page title , not the url variable.

I've tried htmlentities, urlencode, rawurlencode, urldecode, rawurldecode.

Any help would be appreciated.

thank you

Recommended Answers

All 4 Replies

Simply use str_replace as the following:

$X = $_GET['X'];
$pageTitle = str_replace('\\','',$X);
commented: yes +6
$X = mysql_real_escape_string($_GET['X']);

Simply use str_replace as the following:

$X = $_GET['X'];
$pageTitle = str_replace('\\','',$X);

end quote.

thank you both of these worked perfect!

Use stripslashes() function

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.