Validation of Identification card fields (string and array)
Your code looks good, but I notice that you are a Portuguese speaker (as I am), so my only advice would be: Code in English.

There is a good article about idioms and programming called "Why you shouldn’t code in Spanish". In the article the author even uses PHP in the scripts as examples.

Like the old saying: 


  "Always code as if the person who ends up maintaining your code is a
  violent psychopath who knows where you live."


We should code our code in a way that the majority of programmers will understand, so in a way we should (almost always) code in english.