I’m able to run a single php function remotely, and run the scan directory, but I can’t seem to get the output ( It comes back as 5 character string ’Array’, vs an actual array.
You are on the right track, just check how to write a PHP array as a string. There are several methods available in the PHP documentation for this purpose.