note 96334 deleted from function.htmlentities by thiago
| From: | thiago@php.net | Date: | Mon, 22 Feb 2010 02:13:08 +0000 |
| Subject: | note 96334 deleted from function.htmlentities by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166232@lists.php.net to get a copy of this message | ||
Note Submitter: kromped yahoo [dot] com
----
/*
* Recursive html entities
* Author: Kromped
* @param: object, string, array
*/
public function r_html_decode( $var )
{
if( is_array( $var ) )
{
foreach( $var as $r_var )
{
if( is_array( $r_var ) )
{
$r_var = $this->r_html_decode( $r_var );
}
else if( is_object( $r_var ) )
{
$r_var = $this->r_html_decode( $r_var );
}
else
{
$r_var = htmlentities($r_var, ENT_QUOTES);
}
}
}
else if( is_object( $var ) )
{
foreach( $var as $k => $v )
{
$var->{$k} = $this->r_html_decode( $v );
}
}
else
{
$var = htmlentities($var, ENT_QUOTES);
}
return $var;
}