Retuning values to php

I am trying to get php to run AppleScripts and get the return values from them. (sort of like ACGI but using php which i am more familiar with)

php can run applications on the server in two ways. Directly or through a shell.

I get the AppleScripts to launch and perform their tasks but I do not understand how to return values to php. I have tried running AppleScripts from the terminal “./myScript” to see if I get any return values, but no luck.

Where does “return” send its values?
How do I get values to return to the “stdout” of the AppleScript? (which would return it to the shell or php)