Now
This word is used here to mark a pause in the story. Here Matthew explains that Jesus's actions fulfilled scripture.
all this happened to fulfill what was spoken through the prophet
"this happened so that Jesus would fulfill what God spoke through the prophet Zechariah"