I\'m using a script to send email to checked users (approval), but script is sending only to first checked user, here\'s the script:
if (isset($_POST[\'approve\'
You are defining your sendEmail()
function inside your loop. The function is defined in the first iteration of your loop, in the second iteration the error is thrown (because the function already exists) and your script stops. Move the function definition it out of the loop.
You should move ALL your function definitions out of the loop, a function can only be defined once.
Move the sendEmail()
function outside the foreach
loop. Since it is inside the loop so you got the error Cannot redeclare sendEmail()