Can we get getresources output to a php file as array or json string?
I hate to disagree with Susan, but you won't get an array or a JSON string out of that unless you parse the results yourself (doable, but not trivial). getResources returns one big string with the full results. You might be able to modify your Tpl chunk to wrap the result with a snippet that would convert things for you, but I think it would be fairly slow and would use a lot of memory.
If you don't need all the bells and whistles of getResources, you can use a custom snippet.
If you want to post your getResources call and describe the format you want to save, we might be able to come up with some code for you.
Well, I'll be... I could have sworn that getResources had a toJSON property!
migxLoopCollection has a &toJsonPlaceholder - property
than you can use that placeholder in your snippet and do what you want with it.
Now THAT'S cool.
Add a :toFile custom output modifier and you're in business.
Or use runSnippet() in a plugin, like I do with my variation on CSSSweet.