PHP SCP filecount

Hi

I want to do a file count on 3 remote units.

  1. NAS
    2)Offsite Nas
  2. Offsite nas none update

all run linux so i can SSH in to them but is there any way using PHP i could make a script that would remote in to all 3 and do a file count on a folder i specify.

all units have the same file structure for the backups so path’s will not be an issue.