Page 1 of 1

Calling an external php Script

Posted: Fri Jun 24, 2011 8:25 am
by AGISB
I have to do something that was not needed before. I have to create a php script (script1) on a domain. This script gets called by a script (script2) on another domain and the output of script1 (an array) is needed to be further calculated in script2. How is the best way to get this done?

I was thinking of calling the script, output the array e.g. as json string and do a file get contents

Is there a better way this should be done?

Re: Calling an external php Script

Posted: Fri Jun 24, 2011 12:27 pm
by Christopher
That sounds like a fine way to do it. Returning JSON or XML makes sense because they are well supported. You may want to look into RPC or RSS if you are looking for a more standards based way to achieve this.