private function escapeCharacters(array $arr, $escapeValues)
    {
        $returnArr = [];

        foreach ($arr as $key => $value) {
            $returnArr[$this->addSlashes($key)] = $escapeValues ? $this->addSlashes($value) : $value;
        }

        return $returnArr;
    }
private function escapeCharacters(array $arr, $escapeValues)
    {
        $returnArr = [];

        foreach ($arr as $key => $value) {
            $returnArr[$this->addSlashes($key)] = $escapeValues ? $this->addSlashes($value) : $value;
        }

        return $returnArr;
    }
private function escapeCharacters ( array $ arr , $ escapeValues ) { $ returnArr = [ ] ; foreach ( $ arr as $ key => $ value ) { $ returnArr [ $ this -> addSlashes ( $ key ) ] = $ escapeValues ? $ this -> addSlashes ( $ value ) : $ value ; } return $ returnArr ; }
Escapes invalid characters in both the array key and optionally the array value

@param array $arr
@param bool $escapeValues
@return array
Escapes invalid characters in both the array key and optionally the array value