Do return true; continue the script till end in the same function?

indiapekrim

New Member
My function goes something like this\[code\]function multiple_delete($checkbox, $table, $url, $picture1 = 0, $picture2 = 0, $picture3 = 0){ $count = count($checkbox);for($j=0;$j<$count;$j++) { $delete_id = $checkbox[$j]; $query = "SELECT * FROM $table WHERE id = '$delete_id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); return true;if( $picture1 !== 0 && $picture2 !== 0 && $picture3 !== 0) { $pic_1 = $picture1; $pic_2 = $picture2; $pic_3 = $picture3; unlink($pic_1); unlink($pic_2); unlink($pic_3); return true; }if( $picture1 !== 0 && $picture2 !== 0 && $picture3 == 0 ) { $pic_1 = $picture1; $pic_2 = $picture2; unlink($pic_1); unlink($pic_2); return true; } } for($i=0;$i<$count;$i++) { $del_id = $checkbox[$i]; $sql = "DELETE FROM $table WHERE id='$del_id'"; $result_delete_data = http://stackoverflow.com/questions/3588258/mysql_query($sql); } alert('Deleted Successfully'); redirect_url($url); return true; }\[/code\]In the above function if the first or second condition returns true, then will it continue over the for loop below or it will simply halt the script ? If return true will halt the script thenEDIT: Is it ok if I remove the return statement from the if conditions? And is it necessary for us to define the return statement in a user defined function?
 
Back
Top