Foreach insert query the best way

Additionally, you prepare the statement, use it, and then close it every step of the loop. That’s a lot of wasted effort.

Prepare once, use for the loop, then close at the end.

$event_notification = mysqli_prepare($conn, "INSERT INTO user_notifications (notification_sent_by, notification_sent_to, notification_message, notification_time, notification_status, notification_category, notification_category_id) VALUES(?,?,?,now(),?,?,?)");
foreach($datas as $data) {
    $id_cliente = $data['user_join_id'];
    mysqli_stmt_bind_param($event_notification, 'iisisi', $userid, $id_cliente, $notification, $notification_status, $notification_category, $event_id);
    mysqli_stmt_execute($event_notification);
}
mysqli_stmt_close($event_notification);

I would expect that to be a heck of a lot faster.

I am no expert with mysqli and prepared statements but I am pretty sure you can bind all the data into a huge array and do the interest in one hit.

This SO answer suggests that to me, anyway. Given you already built the big array, you should be able to use it without foreach to break it back up. That might be even faster still.