Here is my function that i created for escape strings...

function clean\_array($value)

{

```
      foreach($value as $key => $val)

    {
    if(get_magic_quotes_gpc())
        {
        $value[$key]=stripslashes($val);
        }
    $value[$key]= mysql_real_escape_string($val);
    $value[$key]=htmlentities($val);
    $value[$key]=htmlspecialchars($val);
    }

return $value;
unset($val);

```

}

Please explain step by step bcoz i am beginner in PHP.I am very grateful to u if you give solution...