Ahmad
Ahmad

Reputation: 2129

how to handle html in a URl in php?

I have passing some contents to facebook share url. Which contains some html also.

The problem is it cannot handle the html, When I write , it displays it instead of bolding the text in these tags.

So How will I handle it? I use htmlentities(), htmlspecialcharacters(), and urlencode() but could not solved the problem.

Upvotes: 0

Views: 115

Answers (2)

Rene Pot
Rene Pot

Reputation: 24815

If I understand your question and comment correctly, you want to show a bold text instead of the HTML itself.

So, if you are showing the HTML by doing urlencode() that means the encode is one to many, try without the urlencode()

If that doesn't work, then probably HTML is not supported there.

Upvotes: 0

Cyclonecode
Cyclonecode

Reputation: 30061

You should use urlencode() and do something like:

$link = '<a href="http://www.example-site.com/index.html">link-text</a>';
$encoded = urlencode($link);

Upvotes: 2

Related Questions