Calling an external php Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Calling an external php Script

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Calling an external php Script

Post 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.
(#10850)
Post Reply