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?
Calling an external php Script
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Calling an external php Script
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.
(#10850)