Reputation:
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
Upvotes: 1
Views: 564
Reputation: 10981
$key2 = !empty($_POST['keyboard']) ? $_POST['keyboard'] : array();
This solves the error, whatever you're trying to do.
Upvotes: 2