1

I get this error:

implode(): Invalid arguments passed in error message on line 7

And this is my file:

<?php 
  if (isset($_POST['submit'])) {
    $token = $_POST['token'];
    $cat   = $_POST['cat'];
    $ads   = $_POST['ads'];
    $key2  = !empty($_POST['keyboard']) ? $_POST['keyboard'] : ''; 

    $key = implode(", ", $key2);
    $tel = new Telegram();
    $notice[] = $tel->AddNew($token, $cat, $ads, $key);
  }
?>

So how to fix this ?

Note: This question is due to one of the answers to my other question:

How to insert multiple radio button values with PHP OOP

Kevin Wenger
  • 1,484
  • 1
  • 13
  • 29

1 Answers1

2
 $key2 = !empty($_POST['keyboard']) ? $_POST['keyboard'] : array(); 

This solves the error, whatever you're trying to do.

yoda
  • 10,834
  • 19
  • 64
  • 92