<?php function ean13_check_digit($digits){ //first change digits to a string so that we can access individual numbers $digits =(string)$digits; // 1. Add the values of the digits in the even-numbered positions: 2, 4, 6, etc. $even_sum = $digits{1} + $digits{3} + $digits{5} + $digits{7} + $digits{9} + $digits{11}; // 2. Multiply this result by 3. $even_sum_three…