You are here

public static function Helper::print_form in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Helper.php \Cleantalk\Common\Helper::print_form()

* Print html form for external forms() *

Return value

string

File

src/lib/Cleantalk/Common/Helper.php, line 792

Class

Helper
CleanTalk Helper class. Compatible with any CMS.

Namespace

Cleantalk\Common

Code

public static function print_form($arr, $k) {
  foreach ($arr as $key => $value) {
    if (!is_array($value)) {
      if ($k == '') {
        print '<textarea name="' . $key . '" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
      }
      else {
        print '<textarea name="' . $k . '[' . $key . ']" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
      }
    }
  }
}