I would like to know if there is a way to join in an array several records with a common code, for example I have 3 records whose field code_person is the same, there will be some way that those records form an array that is this way
array([0]([codigo_persona] => PER001, [nombre] => juan),[1]([codigo_persona] => PER001, [nombre] => juan))