,,here is a footnote from one of my Bibles:
From Matthew 1:16
f.n. 16-1
"Here the genealogy says that "Jacob begot Joseph," but Luke 3:23 says, "Joseph, the son of Heli." Luke's record was "according to law" (a literal translation of "so it was thought" in Luke 3:23), indicating that Joseph was not actually the son of Heli but was reckoned his son according to the law. Joseph was the son-in-law of Heli, Mary's father. This may be a case according to Num.27:1-8 and 36:1-12, in which a regulation was made by God that if any parents had only daughters as heirs, the inheritance would go to the daughters, who would then have to marry a man of their own tribe in order to keep their inheritance within that tribe. Even such a regulation in the Old Testament is related to the genealogy of Christ, showing that all scripture is a record of Christ."