mapdev\FacebookMessenger\MessengerUtils::checkStringLengthAndEncoding PHP Method

checkStringLengthAndEncoding() public static method

public static checkStringLengthAndEncoding ( $string, $max_len, $encoding )
    public static function checkStringLengthAndEncoding($string, $max_len, $encoding)
    {
        return self::checkStringEncoding(self::checkStringLength($string, $max_len), $encoding);
    }

Usage Example

 public function toArray()
 {
     $this->checkRecipient();
     return ['recipient' => ['id' => $this->recipient_id], 'message' => ['attachment' => ['type' => 'template', 'payload' => ['template_type' => 'button', 'text' => MessengerUtils::checkStringLengthAndEncoding($this->text, 320, 'UTF-8'), 'buttons' => MessengerUtils::checkArraySize($this->buttons, 3)]]]];
 }
All Usage Examples Of mapdev\FacebookMessenger\MessengerUtils::checkStringLengthAndEncoding