CI_Form_validation::prep_for_form PHP Method

prep_for_form() public method

This function allows HTML to be safely shown in a form. Special characters are converted.
Deprecation: 3.0.6 Not used anywhere within the framework and pretty much useless
public prep_for_form ( mixed $data ) : mixed
$data mixed Input data
return mixed
    public function prep_for_form($data)
    {
        if ($this->_safe_form_data === FALSE or empty($data)) {
            return $data;
        }
        if (is_array($data)) {
            foreach ($data as $key => $val) {
                $data[$key] = $this->prep_for_form($val);
            }
            return $data;
        }
        return str_replace(array("'", '"', '<', '>'), array('&#39;', '&quot;', '&lt;', '&gt;'), stripslashes($data));
    }