Two possible algorithms which solve subset sum problems using PHP.