
November 18th, 2012, 01:43 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 7 m 51 sec
Reputation Power: 0
|
|
PHP5 - Need help understanding how to undo htmlspecialchars
Hi,
New to the forum and need a little help undoing the affects of some php code.
I've been told i need change $alt and $title variables after the extract($params); section in order to get image rollovers to stop showing html code in my title tag. I know it has to do the htmlspecialchars section but just don't know how to write it properly.
Can someone assist me in how i need to rewrite this code snippet to be achieve my end result of just showing the html output and not the actual source code.
Here's the code ->
Code:
extract($params); if(empty($img)) return false; if(empty($medium)) $medium = $img; if(empty($thumb)) $thumb = $img; if(empty($id)) $id = md5($img); if(!empty($title)) { $title = htmlspecialchars(htmlspecialchars_decode($title, ENT_QUOTES)); if(empty($alt)) { $alt = $title; } else { $alt = htmlspecialchars(htmlspecialchars_decode($alt, ENT_QUOTES)); } $title = " title=\"{$title}\""; } else { $title = ''; if(empty($alt)) { $alt = ''; } else { $alt = htmlspecialchars(htmlspecialchars_decode($alt, ENT_QUOTES)); } }
Thanks in advance.
Ryan
|