I get this error from the first line of the following code:
Fatal error: Only variables can be passed by reference in /home/path/file.php on line 36
if (isset($_POST['id']))
{
$ids = array_walk('intval', $_POST['id']);
$sql = "DELETE FROM table WHERE id IN (' . implode(',', $ids) . ')')";
//run query here
$msg->type = "success";
$msg->text = "Bulk delete has been successful";
}
Any ideas what it could be?
BTW, the above code is to mass delete items.
Error is caused by $ids = array_walk('intval', $_POST['id']);
$ids = array_walk('intval', $_POST['id']);
line